%! % PostScript prologue for sphere_object.tex % Version 1.00, 2006/08/02 % /MaillageSphere { 30 dict begin 0 increment 360 increment sub {% /theta exch def departPhi increment 90 increment sub {% /phi exch def % newpath /Xpoint Rsphere theta cos mul phi cos mul def /Ypoint Rsphere theta sin mul phi cos mul def /Zpoint Rsphere phi sin mul def PointsApresTransformations 3dto2d moveto % Centre de la facette /Xpoint Rsphere theta increment 2 div add cos mul phi increment 2 div add cos mul def /Ypoint Rsphere theta increment 2 div add sin mul phi increment 2 div add cos mul def /Zpoint Rsphere phi increment 2 div add sin mul def PointsApresTransformations /zCentreFacette ED /yCentreFacette ED /xCentreFacette ED % normale ŕ la facette /nXfacette xCentreFacette CX sub def /nYfacette yCentreFacette CY sub def /nZfacette zCentreFacette CZ sub def % rayon vers point de vue /RXvue XpointVue xCentreFacette sub def /RYvue YpointVue yCentreFacette sub def /RZvue ZpointVue zCentreFacette sub def % test de visibilité /PSfacette RXvue nXfacette mul RYvue nYfacette mul add RZvue nZfacette mul add def condition { theta 1 theta increment add {% /theta1 exch def /Xpoint Rsphere theta1 cos mul phi cos mul def /Ypoint Rsphere theta1 sin mul phi cos mul def /Zpoint Rsphere phi sin mul def PointsApresTransformations 3dto2d lineto } for phi 1 phi increment add { /phi1 exch def /Xpoint Rsphere theta increment add cos mul phi1 cos mul def /Ypoint Rsphere theta increment add sin mul phi1 cos mul def /Zpoint Rsphere phi1 sin mul def PointsApresTransformations 3dto2d lineto } for theta increment add -1 theta {% /theta1 exch def /Xpoint Rsphere theta1 cos mul phi increment add cos mul def /Ypoint Rsphere theta1 sin mul phi increment add cos mul def /Zpoint Rsphere phi increment add sin mul def PointsApresTransformations 3dto2d lineto } for phi increment add -1 phi { /phi1 exch def /Xpoint Rsphere theta cos mul phi1 cos mul def /Ypoint Rsphere theta sin mul phi1 cos mul def /Zpoint Rsphere phi1 sin mul def PointsApresTransformations 3dto2d lineto } for } if } for } for end } def