root/trunk/pst-map3d/map3d.pro

Revision 26, 18.3 kB (checked in by manuel, 7 months ago)

Correction d'un bug dans l'affichage de l'ombre qui apparaissait lorsque l'observateur était à une faible distance de la Terre.

Line 
1 % premiere version 29 novembre 2003
2 % entierement modifiee le 08/02/2008
3 % allégée de 3D.pro
4 % version 1.0 du 5 mars 2008
5 % manuel.luque27@gmail.com
6 /tx@map3DDict 100 dict def
7 tx@map3DDict begin
8 %%
9 /CalcCoor{
10      /Y exch def /X exch def
11      /Xpoint Y cos X cos mul Rsphere mul def
12      /Ypoint Y cos X sin mul Rsphere mul def
13      /Zpoint Y sin Rsphere mul def
14      } def
15      
16  /CompteurRegions{%
17 /regions_visibles [] def
18 /compteur 0 def
19 {
20    /region exch def
21    /nbr region length def % nombre de points
22    0 1 nbr 1 sub {
23      /counter exch def % pour mémoriser le premier point vu
24      region counter get aload pop
25      CalcCoor
26      CalculsPointsAfterTransformations
27      Test
28      PS condition {% marque le point
29    /regions_visibles [regions_visibles aload pop compteur ] def
30         exit % termine
31      } if
32   } for
33  /compteur compteur 1 add def
34 } forall
35 /TableauRegionsVisibles [
36 0 1 regions_visibles length 1 sub {
37     /NoRegion exch def
38     /No regions_visibles NoRegion get def
39     REGION No get
40     } for
41 ] def
42 TableauRegionsVisibles
43 } def
44
45 /CalculsPointsRegion{%
46     /region1 exch def
47      region1 0 get aload pop
48      CalcCoor
49         newpath
50         CalculsPointsAfterTransformations
51         CalcCoordinates
52         Test
53         PS condition { moveto }{ 2 mul exch 2 mul exch moveto} ifelse
54 %
55     0 1 region1 length 1 sub {
56     /NoPoint exch def
57     region1 NoPoint get aload pop
58     CalcCoor
59         CalculsPointsAfterTransformations
60         CalcCoordinates
61         Test
62         PS condition { lineto }{ 2 mul exch 2 mul exch lineto} ifelse
63     } for
64 } def
65    
66 /MatriceTransformation{%
67     /Sin1 THETA sin def
68     /Sin2 PHI sin def
69     /Cos1 THETA cos def
70     /Cos2 PHI cos def
71     /Cos1Sin2 Cos1 Sin2 mul def
72     /Sin1Sin2 Sin1 Sin2 mul def
73     /Cos1Cos2 Cos1 Cos2 mul def
74     /Sin1Cos2 Sin1 Cos2 mul def
75     /XpointVue Dobs Cos1Cos2 mul def
76     /YpointVue Dobs Sin1Cos2 mul def
77     /ZpointVue Dobs Sin2 mul def
78     /M11 RotZ cos RotY cos mul def
79     /M12 RotZ cos RotY sin mul RotX sin mul
80          RotZ sin RotX cos mul sub def
81     /M13 RotZ cos RotY sin mul RotX cos mul
82          RotZ sin RotX sin mul add def
83     /M21 RotZ sin RotY cos mul def
84     /M22 RotZ sin RotY sin RotX sin mul mul
85          RotZ cos RotX cos mul add def
86     /M23 RotZ sin RotY sin mul RotX cos mul
87          RotZ cos RotX sin mul sub def
88     /M31 RotY sin neg def
89     /M32 RotX sin RotY cos mul def
90     /M33 RotX cos RotY cos mul def
91    } def
92 % RotZ -> RotX -> RotY
93 /MatriceTransformationZXY{%
94     /Sin1 THETA sin def
95     /Sin2 PHI sin def
96     /Cos1 THETA cos def
97     /Cos2 PHI cos def
98     /Cos1Sin2 Cos1 Sin2 mul def
99     /Sin1Sin2 Sin1 Sin2 mul def
100     /Cos1Cos2 Cos1 Cos2 mul def
101     /Sin1Cos2 Sin1 Cos2 mul def
102     /XpointVue Dobs Cos1Cos2 mul def
103     /YpointVue Dobs Sin1Cos2 mul def
104     /ZpointVue Dobs Sin2 mul def
105     /M11 RotZ cos RotY cos mul RotZ sin RotX sin mul RotY sin mul sub def
106     /M12 RotZ sin RotY cos mul RotZ cos RotX sin mul RotY sin mul add def
107     /M13 RotX cos RotY sin mul def
108     /M21 RotZ sin RotX cos mul neg def
109     /M22 RotZ cos RotX cos mul def
110     /M23 RotX sin neg def
111     /M31 RotZ cos neg RotY sin mul RotZ sin RotX sin mul RotY cos mul sub def
112     /M32 RotZ sin neg RotY sin mul RotZ cos RotX sin mul RotY cos mul add def
113     /M33 RotX cos RotY cos mul def
114    } def
115 %
116 /CalcCoordinates{%
117     formulesTroisD
118     Xi xunit Yi yunit
119     }
120     def
121 % pour la 3D conventionnelle
122 /formulesTroisD{%
123     /xObservateur Xabscisse Sin1 mul neg Yordonnee Cos1 mul add def
124     /yObservateur Xabscisse Cos1Sin2 mul neg Yordonnee Sin1Sin2 mul sub Zcote Cos2 mul add def
125     /zObservateur Xabscisse neg Cos1Cos2 mul Yordonnee Sin1Cos2 mul sub Zcote Sin2 mul sub Dobs add def
126     /Xi DScreen xObservateur mul zObservateur div def
127     /Yi DScreen yObservateur mul zObservateur div def
128   }
129 def
130 %
131 /CalculsPointsAfterTransformations{%
132     /Xabscisse M11 Xpoint mul M12 Ypoint mul add M13 Zpoint mul add def
133     /Yordonnee M21 Xpoint mul M22 Ypoint mul add M23 Zpoint mul add def
134     /Zcote M31 Xpoint mul M32 Ypoint mul add M33 Zpoint mul add def
135     }
136 def
137 %
138 /Test { % test de visibilité d'un point
139 % rayon vers point de vue
140     /RXvue XpointVue Xabscisse sub def
141     /RYvue YpointVue Yordonnee sub def
142     /RZvue ZpointVue Zcote sub def
143 % test de visibilité
144     /PS RXvue Xabscisse mul % produit scalaire
145         RYvue Yordonnee mul add
146         RZvue Zcote mul add
147     def
148 } def
149 %
150 /MaillageSphere {
151 gsave
152 maillagewidth
153 maillagecolor
154 0.25 setlinewidth
155 0 increment 360 increment sub {%
156     /theta exch def
157 -90 increment 90 increment sub {%
158     /phi exch def
159 % newpath
160     /Xpoint Rsphere theta cos mul phi cos mul def
161     /Ypoint Rsphere theta sin mul phi cos mul def
162     /Zpoint Rsphere phi sin mul def
163 CalculsPointsAfterTransformations
164     CalcCoordinates
165      moveto
166 % Centre de la facette
167     /Xpoint Rsphere theta increment 2 div add cos mul phi increment 2 div add cos mul def
168     /Ypoint Rsphere theta increment 2 div add sin mul phi increment 2 div add cos mul def
169     /Zpoint Rsphere phi increment 2 div add sin mul def
170 CalculsPointsAfterTransformations
171     /xCentreFacette Xabscisse def
172     /yCentreFacette Yordonnee def
173     /zCentreFacette Zcote def
174 % normale à la facette
175     /nXfacette xCentreFacette def
176     /nYfacette yCentreFacette def
177     /nZfacette zCentreFacette def
178 % rayon vers point de vue
179     /RXvue XpointVue xCentreFacette sub def
180     /RYvue YpointVue yCentreFacette sub def
181     /RZvue ZpointVue zCentreFacette sub def
182 % test de visibilité
183     /PSfacette RXvue nXfacette mul
184     RYvue nYfacette mul add
185     RZvue nZfacette mul add
186     def
187 PSfacette condition {
188 theta 1 theta increment add {%
189     /theta1 exch def
190     /Xpoint Rsphere theta1 cos mul phi cos mul def
191     /Ypoint Rsphere theta1 sin mul phi cos mul def
192     /Zpoint Rsphere phi sin mul def
193 CalculsPointsAfterTransformations
194     CalcCoordinates
195     lineto
196     } for
197 phi 1 phi increment add {
198     /phi1 exch def
199     /Xpoint Rsphere theta increment add cos mul phi1 cos mul def
200     /Ypoint Rsphere theta increment add sin mul phi1 cos mul def
201     /Zpoint Rsphere phi1 sin mul def
202 CalculsPointsAfterTransformations
203     CalcCoordinates
204     lineto
205     } for
206 theta increment add -1 theta {%
207     /theta1 exch def
208     /Xpoint Rsphere theta1 cos mul phi increment add cos mul def
209     /Ypoint Rsphere theta1 sin mul phi increment add cos mul def
210     /Zpoint Rsphere phi increment add sin mul def
211 CalculsPointsAfterTransformations
212     CalcCoordinates
213     lineto
214     } for
215 phi increment add -1 phi {
216     /phi1 exch def
217     /Xpoint Rsphere theta cos mul phi1 cos mul def
218     /Ypoint Rsphere theta sin mul phi1 cos mul def
219     /Zpoint Rsphere phi1 sin mul def
220 CalculsPointsAfterTransformations
221     CalcCoordinates
222     lineto
223         } for
224 } if
225 } for
226 } for
227 stroke
228 } def
229 %
230 /DrawCitys {
231 /CITY exch def
232 /Rayon exch def
233 /nbr CITY length def % nombre de villes
234 0 1 nbr 1 sub {
235   /compteur exch def
236   CITY compteur get aload pop
237   /X exch def /Y exch def
238   /Xpoint {%
239     Y cos X cos mul Rsphere mul
240     } def
241   /Ypoint {%
242     Y cos X sin mul Rsphere mul
243     } def
244   /Zpoint { Y sin Rsphere mul } def
245 CalculsPointsAfterTransformations
246     CalcCoordinates
247 Test
248 PS condition %
249  {1 0 0 setrgbcolor newpath Rayon 0 360 arc closepath fill}{pop pop}
250  ifelse
251 } for
252 } def
253
254 /oceans_seas_hatched {
255 -90 circlesep 90 {
256   /latitude_parallel exch def
257   Parallel
258   circlecolor
259   circlewidth
260   stroke
261   } for
262  } def
263
264 /meridien {
265 % liste des points vus
266 /TabPointsVusNeg[
267 -180 1 0{ % for
268     /phi exch def
269     /Xpoint Rsphere longitude_meridien cos mul phi cos mul def
270     /Ypoint Rsphere longitude_meridien sin mul phi cos mul def
271     /Zpoint Rsphere phi sin mul def
272 CalculsPointsAfterTransformations
273     Test
274     PS condition { phi } if
275     } for
276 ] def
277 %
278 /TabPointsVusPos[
279 0 1 180{ % for
280     /phi exch def
281     /Xpoint Rsphere longitude_meridien cos mul phi cos mul def
282     /Ypoint Rsphere longitude_meridien sin mul phi cos mul def
283     /Zpoint Rsphere phi sin mul def
284 CalculsPointsAfterTransformations
285     Test
286     PS condition { phi } if
287     } for
288 ] def 
289 % plus grand et plus petit
290
291 /phi_minNeg 0 def
292 /phi_maxNeg -180 def
293
294 0 1 TabPointsVusNeg length 1 sub { % for
295     /iPoint exch def
296     /phi TabPointsVusNeg iPoint get def
297      phi phi_minNeg le {/phi_minNeg phi def} if
298     } for
299 0 1 TabPointsVusNeg length 1 sub { % for
300     /iPoint exch def
301     /phi TabPointsVusNeg iPoint get def
302     phi phi_maxNeg ge {/phi_maxNeg phi def} if
303     } for
304    
305 /phi_minPos 180 def
306 /phi_maxPos   0 def
307    
308 0 1 TabPointsVusPos length 1 sub { % for
309     /iPoint exch def
310     /phi TabPointsVusPos iPoint get def
311      phi phi_minPos le {/phi_minPos phi def} if
312     } for
313 0 1 TabPointsVusPos length 1 sub { % for
314     /iPoint exch def
315     /phi TabPointsVusPos iPoint get def
316      phi phi_maxPos ge {/phi_maxPos phi def} if
317     } for
318
319      /Xpoint Rsphere longitude_meridien cos mul phi_minNeg cos mul def
320      /Ypoint Rsphere longitude_meridien sin mul phi_minNeg cos mul def
321      /Zpoint Rsphere phi_minNeg sin mul def
322      CalculsPointsAfterTransformations
323      CalcCoordinates
324      moveto   
325      
326 phi_minNeg 1 phi_maxNeg{
327  /phi exch def
328      /Xpoint Rsphere longitude_meridien cos mul phi cos mul def
329      /Ypoint Rsphere longitude_meridien sin mul phi cos mul def
330      /Zpoint Rsphere phi sin mul def
331 CalculsPointsAfterTransformations
332    CalcCoordinates
333    lineto
334    } for
335 meridiencolor
336 meridienwidth
337 stroke
338
339      /Xpoint Rsphere longitude_meridien cos mul phi_minPos cos mul def
340      /Ypoint Rsphere longitude_meridien sin mul phi_minPos cos mul def
341      /Zpoint Rsphere phi_minPos sin mul def
342      CalculsPointsAfterTransformations
343      CalcCoordinates
344      moveto
345      
346 phi_minPos 1 phi_maxPos{
347  /phi exch def
348      /Xpoint Rsphere longitude_meridien cos mul phi cos mul def
349      /Ypoint Rsphere longitude_meridien sin mul phi cos mul def
350      /Zpoint Rsphere phi sin mul def
351 CalculsPointsAfterTransformations
352    CalcCoordinates
353    lineto
354    } for
355 meridiencolor
356 meridienwidth
357 stroke
358 }
359 def
360
361 %% macros de Jean-Paul Vignault
362 %% dans solides.pro
363 %% produit vectoriel de deux vecteurs 3d
364 /vectprod3d { %% x1 y1 z1 x2 y2 z2
365 6 dict begin
366    /zp exch def
367    /yp exch def
368    /xp exch def
369    /z exch def
370    /y exch def
371    /x exch def
372    y zp mul z yp mul sub
373    z xp mul x zp mul sub
374    x yp mul y xp mul sub
375 end
376 } def
377
378 % coordonnées sphériques -> coordonnées cartésiennes
379 /rtp2xyz {
380 6 dict begin
381    /phi exch def
382    /theta exch def
383    /r exch def
384    /x phi cos theta cos mul r mul def
385    /y phi cos theta sin mul r mul def
386    /z phi sin r mul def
387    x y z
388 end
389 } def
390
391 %% norme d'un vecteur 3d
392 /norme3d { %% x y z
393 3 dict begin
394    /z exch def
395    /y exch def
396    /x exch def
397    x dup mul y dup mul add z dup mul add sqrt
398 end
399 } def
400
401 %% duplique le vecteur 3d
402 /dupp3d { %% x y z
403         3 copy
404 } def
405 /dupv3d {dupp3d} def
406
407 %%%%% ### mulv3d ###
408 %% (scalaire)*(vecteur 3d) Attention : dans l autre sens !
409 /mulv3d { %% x y z lambda
410 4 dict begin
411    /lambda exch def
412    /z exch def
413    /y exch def
414    /x exch def
415    x lambda mul
416    y lambda mul
417    z lambda mul
418 end
419 } def
420
421 %%%%% ### defpoint3d ###
422 %% creation du point A a partir de xA yA yB et du nom /A
423 /defpoint3d { %% xA yA zA /nom
424 1 dict begin
425    /memo exch def
426    [ 4 1 roll ] cvx memo exch
427 end def
428 }def
429
430 %%%%% ### scalprod3d ###
431 %% produit scalaire de deux vecteurs 3d
432 /scalprod3d { %% x1 y1 z1 x2 y2 z2
433 6 dict begin
434    /zp exch def
435    /yp exch def
436    /xp exch def
437    /z exch def
438    /y exch def
439    /x exch def
440    x xp mul y yp mul add z zp mul add
441 end
442 } def
443
444 %%%%% ### addv3d ###
445 %% addition de deux vecteurs 3d
446 /addv3d { %% x1 y1 z1 x2 y2 z2
447 6 dict begin
448    /zp exch def
449    /yp exch def
450    /xp exch def
451    /z exch def
452    /y exch def
453    /x exch def
454    x xp add
455    y yp add
456    z zp add
457 end
458 } def
459
460 /arccos {
461    dup
462    dup mul neg 1 add sqrt
463    exch
464    atan
465 } def
466 %% fin des macros de Jean-Paul Vignault
467 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
468
469 %%%%% ### rotV3d ###
470 %% rotation autour d'un vecteur u
471 %% defini par (ux,uy,uz)
472 %% ici l'axe des pôles de la Terre
473 %% d'un angle theta
474 /rotV3d {
475 15 dict begin
476     /N2uvw ux dup mul uy dup mul add uz dup mul add def
477     /N2uv  ux dup mul uy dup mul add def
478     /N2vw  uz dup mul uy dup mul add def
479     /N2uw  uz dup mul ux dup mul add def
480     /z exch def /y exch def /x exch def
481     /uxvywz ux x mul uy y mul add uz z mul add def
482     /uxvy   ux x mul uy y mul add def
483     /uxwz   ux x mul uz z mul add def
484     /vywz   uy y mul uz z mul add def
485     /_wyvz  uz y mul neg uy z mul add def
486     /wx_uz  uz x mul ux z mul sub def
487     /_vxuy  uy x mul neg ux y mul add def
488     ux uxvywz mul x N2vw mul ux vywz mul sub theta cos mul add N2uvw sqrt _wyvz mul theta sin mul add N2uvw div
489     uy uxvywz mul y N2uw mul uy uxwz mul sub theta cos mul add N2uvw sqrt wx_uz mul theta sin mul add N2uvw div
490     uz uxvywz mul z N2uv mul uz uxvy mul sub theta cos mul add N2uvw sqrt _vxuy mul theta sin mul add N2uvw div
491 end
492  } def
493
494
495 /the_night{
496 50 dict begin
497  /theta {180 hour 15 mul sub} bind def
498 % direction des rayons du soleil au solstice d'hiver
499    u1 u2 u3 /u defpoint3d
500 % vecteur normal dans le plan meridien
501 % la latitude
502 %  /phi0 u2 neg u3 atan def
503 u1 u2 u3 rotV3d
504     /nZ exch def /nY exch def pop
505   /phi0 nY neg nZ atan def
506 % vecteur normal dans le plan equateur
507    /theta0 u1 neg u2 atan def
508     theta0 cos theta0 sin 0 /v defpoint3d
509 % w tels que le trièdre u v w soit direct
510    u v vectprod3d dupp3d norme3d 1 exch div mulv3d /w defpoint3d
511 /TabPointsVusNeg[
512 -180 1 0{ % for
513    /t exch def
514     v t cos Rsphere mul mulv3d
515     w t sin Rsphere mul mulv3d
516          addv3d
517     rotV3d
518    /Zpoint exch def /Ypoint exch def /Xpoint exch def
519    CalculsPointsAfterTransformations
520     Test
521     PS 0 ge { t } if
522     } for
523 ] def
524 %
525 /TabPointsVusPos[
526 0 1 180{ % for
527    /t exch def
528     v t cos Rsphere mul mulv3d
529     w t sin Rsphere mul mulv3d
530          addv3d
531     rotV3d
532    /Zpoint exch def /Ypoint exch def /Xpoint exch def
533    CalculsPointsAfterTransformations
534     Test
535     PS 0 ge { t } if
536     } for
537 ] def
538 /t_minNeg 0 def
539 /t_maxNeg -180 def
540
541 0 1 TabPointsVusNeg length 1 sub { % for
542     /iPoint exch def
543     /t TabPointsVusNeg iPoint get def
544      t t_minNeg le {/t_minNeg t def} if
545     } for
546 0 1 TabPointsVusNeg length 1 sub { % for
547     /iPoint exch def
548     /t TabPointsVusNeg iPoint get def
549      t t_maxNeg ge {/t_maxNeg t def} if
550     } for
551
552 /t_minPos 180 def
553 /t_maxPos   0 def
554
555 0 1 TabPointsVusPos length 1 sub { % for
556     /iPoint exch def
557     /t TabPointsVusPos iPoint get def
558      t t_minPos le {/t_minPos t def} if
559     } for
560 0 1 TabPointsVusPos length 1 sub { % for
561     /iPoint exch def
562     /t TabPointsVusPos iPoint get def
563      t t_maxPos ge {/t_maxPos t def} if
564     } for
565
566 theta -90 ge theta 90 le and {
567           v t_minNeg cos Rsphere mul mulv3d
568           w t_minNeg sin Rsphere mul mulv3d
569          addv3d
570    rotV3d
571    /Zpoint exch def /Ypoint exch def /Xpoint exch def
572    CalculsPointsAfterTransformations
573    CalcCoordinates
574      moveto
575
576 t_minNeg 1 t_maxPos{
577          /t  exch def
578           v t cos Rsphere mul mulv3d
579           w t sin Rsphere mul mulv3d
580          addv3d
581    rotV3d
582    /Zpoint exch def /Ypoint exch def /Xpoint exch def
583    CalculsPointsAfterTransformations
584    CalcCoordinates
585    lineto
586    } for
587 phi0 1 phi0 180 add { /t exch def
588 RsphereScreen t cos mul
589 RsphereScreen t sin mul
590    lineto
591    } for
592 }{
593           v t_minPos cos Rsphere mul mulv3d
594           w t_minPos sin Rsphere mul mulv3d
595          addv3d
596    rotV3d
597    /Zpoint exch def /Ypoint exch def /Xpoint exch def
598    CalculsPointsAfterTransformations
599    CalcCoordinates
600      moveto
601
602 t_minPos 1 t_maxPos {
603          /t  exch def
604           v t cos Rsphere mul mulv3d
605           w t sin Rsphere mul mulv3d
606          addv3d
607    rotV3d
608    /Zpoint exch def /Ypoint exch def /Xpoint exch def
609    CalculsPointsAfterTransformations
610    CalcCoordinates
611    lineto
612    } for
613 t_minNeg 1 t_maxNeg {
614          /t  exch def
615           v t cos Rsphere mul mulv3d
616           w t sin Rsphere mul mulv3d
617          addv3d
618    rotV3d
619    /Zpoint exch def /Ypoint exch def /Xpoint exch def
620    CalculsPointsAfterTransformations
621    CalcCoordinates
622    lineto
623    } for
624 phi0 1 phi0 180 add { /t exch def
625 RsphereScreen t cos mul
626 RsphereScreen t sin mul
627    lineto
628    } for
629 } ifelse
630 closepath
631 end
632 }
633 def
634
635 % ondes seismes
636 /ondes {
637  50 dict begin
638     /l exch def % latitude : phi
639     /L exch def % longitude : theta
640     /dlmax exch def % intervalle maximal en degrés
641     /nbr exch def % nombre de cercles
642     /dl dlmax nbr div def
643 % le vecteur unitaire normal
644 % à la sphère au point considéré
645   L cos l cos mul
646   L sin l cos mul
647   l sin
648   /u defpoint3d
649 1 1 nbr {  /i exch def
650     /l' l dl i mul add def
651     /r  Rsphere dl i mul cos mul def
652     /r' Rsphere dl i mul sin mul def
653 % le centre de l'onde
654     /x_o r L cos mul l cos mul def
655     /y_o r L sin mul l cos mul def
656     /z_o r l sin mul def
657 % un vecteur unitaire du plan du cercle
658 % perpendiculaire à n et dans le plan méridien
659 % donc même longitude
660     /x_I Rsphere L cos mul l' cos mul def
661     /y_I Rsphere L sin mul l' cos mul def
662     /z_I Rsphere l' sin mul def
663    x_I x_o sub
664    y_I y_o sub
665    z_I z_o sub
666    /uOI defpoint3d
667    uOI dupp3d norme3d 1 exch div mulv3d
668    /v defpoint3d
669 % un vecteur w normal à u et v dans le plan du cercle
670    u v vectprod3d dupp3d norme3d 1 exch div mulv3d
671    /w defpoint3d
672 % on décrit le cercle
673
674           v 0 cos r' mul mulv3d
675           w 0 sin r' mul mulv3d
676          addv3d x_o y_o z_o addv3d
677    /Zpoint exch def /Ypoint exch def /Xpoint exch def
678    CalculsPointsAfterTransformations
679    CalcCoordinates
680    moveto
681 0 1 360{%
682          /t  exch def
683           v t cos r' mul mulv3d
684           w t sin r' mul mulv3d
685          addv3d x_o y_o z_o addv3d
686    /Zpoint exch def /Ypoint exch def /Xpoint exch def
687    CalculsPointsAfterTransformations
688    CalcCoordinates
689    lineto
690    } for
691 stroke
692  } for
693 end
694 } def
695
696 %% nouvelle construction des parallèles
697 /Parallel {
698 0 1 360{ % for
699     /theta exch def
700     /Xpoint Rsphere theta cos mul latitude_parallel cos mul def
701     /Ypoint Rsphere theta sin mul latitude_parallel cos mul def
702     /Zpoint Rsphere latitude_parallel sin mul def
703 CalculsPointsAfterTransformations
704     Test
705     PS condition {
706     CalcCoordinates
707     moveto
708     /theta theta 1 add def
709     /Xpoint Rsphere theta cos mul latitude_parallel cos mul def
710     /Ypoint Rsphere theta sin mul latitude_parallel cos mul def
711     /Zpoint Rsphere latitude_parallel sin mul def
712 CalculsPointsAfterTransformations
713 Test
714     PS condition {
715 CalcCoordinates
716     lineto }
717     {
718         /theta theta 1 sub def
719     /Xpoint Rsphere theta cos mul latitude_parallel cos mul def
720     /Ypoint Rsphere theta sin mul latitude_parallel cos mul def
721     /Zpoint Rsphere latitude_parallel sin mul def
722 CalculsPointsAfterTransformations
723 CalcCoordinates
724     lineto
725      } ifelse
726     } if
727     } for
728 } def
729 end
Note: See TracBrowser for help on using the browser.