2 %Auteur:Christophe Poulain
11 c:=57.29578; % conversion d'un radian en degrés
13 color _T[],rouge,vert,bleu,jaune,noir,blanc,orange,rose,violet,ciel,cielfonce,orangevif,gris,tan,payscolor;
22 cielfonce=(0.25,0.75,1);
24 orangevif=(1,0.25,0.1);
29 tan=(0.824,0.705,0.55);
32 vardef flamme=reverse(2mm*(0.5,1){dir90}..2mm*(0.75,1.5)..{dir90}2mm*(1,2))--2mm*(0.5,1){dir=-90}..2mm*(1,0.5)..{dir=90}2mm*(1.5,1)--((2mm*(0.5,1){dir90}..2mm*(0.75,1.5)..{dir90}2mm*(1,2)) reflectedabout (2mm*(1,0),2mm*(1,0)+2mm*(0,1)))--cycle
41 def MarquePoint(expr p)=
42 if marque_p = "creux":
44 fill fullcircle scaled (marque_r/5) shifted (Projgeo(p)) withcolor white;
45 draw fullcircle scaled (marque_r/5) shifted (Projgeo(p));
47 fill fullcircle scaled (marque_r/5) shifted (p) withcolor white;
48 draw fullcircle scaled (marque_r/5) shifted (p);
53 vardef pointe(text t) =
54 for p_ = t: if (pair p_) or (color p_): MarquePoint(p_); fi endfor;
57 %Définition pour la feuille
64 def feuille(expr xa,ya,xb,yb) =
68 feuillet := (xa,ya)--(xa,yb)--(xb,yb)--(xb,ya)--cycle;
69 extra_endfig := "clip currentpicture to feuillet;" & extra_endfig;
72 def figureespace(expr xa,ya,xb,yb) =
82 def figure(expr xa,ya,xb,yb)=figureespace(xa,ya,xb,yb)
88 %definitions mathématiques
89 vardef cercles(text t)=
101 for k=0 step 5 until 360 :
102 ptcer[k div 5]-_T[1]=Distance(_T[1],_T[2])*((_T[4]-_T[3])*cosd(k)/Distance(_T[3],_T[4])+(_T[5]-_T[3])*sind(k)/Distance(_T[3],_T[5]));
105 for k=0 step 5 until 360 :
106 ..Projgeo(ptcer[k div 5])
112 vardef arcsind(expr x)=%en degré ici :)
113 angle((sqrt(1-x**2),x))
116 vardef tand(expr x)=sind(x)/cosd(x)%
119 vardef cotand(expr x)=cosd(x)/sind(x)%
122 vardef ln(expr t)=mlog(t)/256%
125 %représentation paramétrique de la sphère terrestre.
126 vardef FX(expr t,v)=rayon*cosd(c*t)*cosd(c*v)
129 vardef FY(expr t,v)=rayon*cosd(c*t)*sind(c*v)
132 vardef FZ(expr t,v)=rayon*sind(c*t)
135 %Paramètres et macros de représentation
136 vardef Initialisation(expr r,t,p,d)=
151 vardef Oeil=(Rho*Aux7,Rho*Aux8,Rho*Aux2)
154 vardef Vision(expr num)=
157 bb=(redpart(Oeil-Sommet[num]),greenpart(Oeil-Sommet[num]),bluepart(Oeil-Sommet[num]));
161 vardef Normal(expr vecun,vecde,vectr)=
164 P1:=redpart(vecde-vecun);
165 P2:=greenpart(vecde-vecun);
166 P3:=bluepart(vecde-vecun);
167 Q1:=redpart(vectr-vecun);
168 Q2:=greenpart(vectr-vecun);
169 Q3:=bluepart(vectr-vecun);
170 aa=(P2*Q3-Q2*P3,P3*Q1-Q3*P1,P1*Q2-Q1*P2);
174 vardef ProduitScalaire(expr wec,mor)=
175 redpart(wec)*redpart(mor)+greenpart(wec)*greenpart(mor)+bluepart(wec)*bluepart(mor)
178 vardef Distance(expr aa,bb)=%Entre deux points
179 sqrt((redpart(bb)-redpart(aa))*(redpart(bb)-redpart(aa))+(greenpart(bb)-greenpart(aa))*(greenpart(bb)-greenpart(aa))+(bluepart(bb)-bluepart(aa))*(bluepart(bb)-bluepart(aa)))
184 color CentMaillage[];
187 for k=Udebut step 0.5*pasU until (Ufin):
188 for l=Vdebut step pasV until (Vfin):
189 Maillage[100*k+l]=Projgeo((FX(k,l),FY(k,l),FZ(k,l)))--Projgeo((FX(k,l+pasV),FY(k,l+pasV),FZ(k,l+pasV)))--Projgeo((FX(k+pasU,l+pasV),FY(k+pasU,l+pasV),FZ(k+pasU,l+pasV)))--Projgeo((FX(k+pasU,l),FY(k+pasU,l),FZ(k+pasU,l)))--cycle;
190 if ProduitScalaire(1/2[(FX(k,l),FY(k,l),FZ(k,l)),(FX(k+pasU,l+pasV),FY(k+pasU,l+pasV),FZ(k+pasU,l+pasV))]-pte3,Oeil-pte3)>0:
195 draw Maillage[100*k+l];
200 %for k=(Udebut+pasU) step pasU until (Ufin-pasU):
201 % if abs(round(k*c))<100:
202 % label.urt(TEX(""&decimal(round(k*c))&""),Projgeo(rayon*(cosd(round(k*c))*cosd(Theta),cosd(round(k*c))*sind(Theta),sind(round(k*c)))))
206 %Vmax:=Vmin+2*((Theta/c)-Vmin);
207 %label.top(TEX(""&decimal(round(Vmin*c))&"") rotated angle(Projgeo(rayon*(cosd(phim+10)*cosd(round(Vmin*c)),cosd(phim+10)*sind(round(Vmin*c)),sind(phim+10)))-Projgeo(rayon*(cosd(phim)*cosd(round(Vmin*c)),cosd(phim)*sind(round(Vmin*c)),sind(phim)))),Projgeo(rayon*(cosd(phim)*cosd(round(Vmin*c)),cosd(phim)*sind(round(Vmin*c)),sind(phim))));
208 %label.top(TEX(""&decimal(round(Theta))&"") rotated angle(Projgeo(rayon*(cosd(phim+10)*cosd(round(Theta)),cosd(phim+10)*sind(round(Theta)),sind(phim+10)))-Projgeo(rayon*(cosd(phim)*cosd(round(Theta)),cosd(phim)*sind(round(Theta)),sind(phim)))),Projgeo(rayon*(cosd(phim)*cosd(round(Theta)),cosd(phim)*sind(round(Theta)),sind(phim))));
209 %label.top(TEX(""&decimal(round(Vmax*c))&"") rotated angle(Projgeo(rayon*(cosd(phim+10)*cosd(round(Vmax*c)),cosd(phim+10)*sind(round(Vmax*c)),sind(phim+10)))-Projgeo(rayon*(cosd(phim)*cosd(round(Vmax*c)),cosd(phim)*sind(round(Vmax*c)),sind(phim)))),Projgeo(rayon*(cosd(phim)*cosd(round(Vmax*c)),cosd(phim)*sind(round(Vmax*c)),sind(phim))));
212 vardef InitialiseMaillage(expr ud,uf,up,vd,vf,vp)=
221 vardef MaillageSphere=
222 InitialiseMaillage(((phim div 10)+1)*pi/18,((phip div 10)-1)*pi/18,pi/18,-pi,pi,pi/36);
229 vardef ParaMeri(expr lonn,latt)=%longitude et latitude en degrés%Parallèle et méridien particulier pour une représentation 3d.
236 InitialiseMaillage(((phim div 10)+1)*pi/18,((phip div 10)-1)*pi/18,pi/36,-pi,pi,pi/72);
237 path SMaillage[];picture Smaille;
238 drawoptions(withpen pencircle scaled 2bp withcolor orangevif);
239 for l=Vdebut step pasV until (Vfin+pasV):
240 SMaillage[100*latpar+l]=Projgeo((FX(latpar/c,l),FY(latpar/c,l),FZ(latpar/c,l)))--Projgeo((FX(latpar/c,l+pasV),FY(latpar/c,l+pasV),FZ(latpar/c,l+pasV)));
241 if ProduitScalaire(1/2[(FX(latpar/c,l),FY(latpar/c,l),FZ(latpar/c,l)),(FX(latpar/c,l+pasV),FY(latpar/c,l+pasV),FZ(latpar/c,l+pasV))]-pte3,Oeil-pte3)>0:
242 draw SMaillage[100*latpar+l];
245 for k=Udebut step pasU until (Ufin+pasU):
246 SMaillage[k+100*lonpar]:=Projgeo((FX(k,lonpar/c),FY(k,lonpar/c),FZ(k,lonpar/c)))--Projgeo((FX(k+pasU,lonpar/c),FY(k+pasU,lonpar/c),FZ(k+pasU,lonpar/c)));
247 if ProduitScalaire(1/2[(FX(k,lonpar/c),FY(k,lonpar/c),FZ(k,lonpar/c)),(FX(k+pasU,lonpar/c),FY(k+pasU,lonpar/c),FZ(k+pasU,lonpar/c))]-pte3,Oeil-pte3)>0:
248 draw SMaillage[k+100*lonpar];
255 vardef Projgeo(expr X)=
257 numeric Xobs,Yobs,Zobs,XProj,YProj;
258 Xobs = -redpart(X)*Aux1 + greenpart(X)*Aux3;
259 Yobs = -redpart(X)*Aux5 - greenpart(X)*Aux6 + bluepart(X)*Aux4;
260 Zobs = -redpart(X)*Aux7 - greenpart(X)*Aux8 - bluepart(X)*Aux2 + Rho;
261 XProj = DE*Xobs/Zobs;
262 YProj = DE*Yobs/Zobs;
268 numeric nbpts,nblec,nbcapitales;
271 arborescence:="data/";
273 vardef lecture(expr nomfichier,fond)=
274 color Coord[],Pays[];
277 nbpts:=scantokens readfrom nomfichier;
278 for k=1 upto (nbpts div 3):
280 latlon=((scantokens readfrom nomfichier)+(scantokens readfrom nomfichier)+(scantokens readfrom nomfichier))/3;
281 Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
282 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
283 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
293 closefrom nomfichier;
296 pays=Projgeo(Pays[1])
297 for l=2 upto (nbpts div 3):
301 fill pays--cycle withcolor payscolor;
303 fill pays--cycle withcolor fond;
306 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
310 string nomfichiermul,NomFichier;
313 nomfichiermul:=arborescence&"iles.dat";
314 nblec:=scantokens readfrom nomfichiermul;
316 color Coord[],fond,Pays[];
319 nbpts:=scantokens readfrom nomfichiermul;
320 fond=scantokens readfrom nomfichiermul;
323 latlon=scantokens readfrom nomfichiermul;
324 Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
325 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
326 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
338 pays=Projgeo(Pays[1])
343 fill pays--cycle withcolor payscolor;
345 fill pays--cycle withcolor fond;
348 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
351 closefrom nomfichiermul;
355 nomfichiermul:=arborescence&"lacs.dat";
356 nblec:=scantokens readfrom nomfichiermul;
358 color Coord[],Pays[];
361 nbpts:=scantokens readfrom nomfichiermul;
364 latlon=scantokens readfrom nomfichiermul;
365 Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
366 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
367 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
379 pays=Projgeo(Pays[1])
383 fill pays--cycle withcolor cielfonce;
385 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
388 closefrom nomfichiermul;
391 vardef Lecturelacssup=
392 nomfichiermul:=arborescence&"lacssup.dat";
393 nblec:=scantokens readfrom nomfichiermul;
395 color Coord[],Pays[];
398 nbpts:=scantokens readfrom nomfichiermul;
401 latlon=scantokens readfrom nomfichiermul;
402 Coord[k]=rayon*(cosd(xpart(latlon))*cosd(ypart(latlon)),cosd(xpart(latlon))*sind(ypart(latlon)),sind(xpart(latlon)));
403 if ((xpart(latlon)>phim) and (xpart(latlon)<phip)):
404 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
416 pays=Projgeo(Pays[1])
420 fill pays--cycle withcolor cielfonce;
422 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
425 closefrom nomfichiermul;
428 vardef Lecturevolcans=
429 drawoptions(withcolor orange);
430 nomfichiermul:=arborescence&"volcans.dat";
431 nblec:=scantokens readfrom nomfichiermul;
434 color Coord[],Pays[];
436 latlon=scantokens readfrom nomfichiermul;
437 Coord[p]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
438 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
439 if ProduitScalaire(Coord[p]-pte3,Oeil-pte3)>0:
441 fill flamme shifted Projgeo(Pays[p]) withcolor 1/2[orange,jaune];
443 % Pays[k]=2*Coord[k];
446 % Pays[k]=2*Coord[k];
449 closefrom nomfichiermul;
453 vardef Lecturerivieres=
454 nomfichiermul:=arborescence&"rivieres.dat";
455 nblec:=scantokens readfrom nomfichiermul;
457 color Coord[],fond,Pays[];
460 nbpts:=scantokens readfrom nomfichiermul;
463 latlon=scantokens readfrom nomfichiermul;
464 Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
465 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
466 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
478 pays=Projgeo(Pays[1])
482 draw pays withcolor cielfonce;
483 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
486 closefrom nomfichiermul;
489 vardef Lecturerivieressup=
490 nomfichiermul:=arborescence&"fleuveseurope.dat";
491 nblec:=scantokens readfrom nomfichiermul;
493 color Coord[],fond,Pays[];
496 nbpts:=scantokens readfrom nomfichiermul;
499 latlon=scantokens readfrom nomfichiermul;
500 Coord[k]=rayon*(cosd(xpart(latlon))*cosd(ypart(latlon)),cosd(xpart(latlon))*sind(ypart(latlon)),sind(xpart(latlon)));
501 if ((xpart(latlon)>phim) and (xpart(latlon)<phip)):
502 if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0:
514 pays=Projgeo(Pays[1])
518 draw pays withcolor cielfonce;
519 clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4);
522 closefrom nomfichiermul;
525 vardef Lecturecapitales=
527 nomfichiermul:=arborescence&"capitales.dat";
528 nbcapitales:=scantokens readfrom nomfichiermul;
529 for p=1 upto nbcapitales:
534 p_=scantokens readfrom nomfichiermul;
535 latlon=scantokens readfrom nomfichiermul;
536 Coord[p]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60)));
538 label.top(p_,Projgeo(Coord[p]));
540 if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)):
541 if ProduitScalaire(Coord[p]-pte3,Oeil-pte3)>0:
547 closefrom nomfichiermul;
551 vardef Lecture(expr Nomfichier)=
552 NomFichier:=arborescence&Nomfichier;
553 nblec:=scantokens readfrom NomFichier;
556 lecture(scantokens readfrom NomFichier);
558 lecturep(scantokens readfrom NomFichier);
561 closefrom NomFichier;
564 %Pour les projections
568 vardef zoom(expr nbzoom)=
569 if projection="mercator":
572 elseif projection="cylindrique":
575 elseif projection="simple":
576 xunit:=nbzoom*0.5*mm;
577 yunit:=nbzoom*0.5*mm;
578 elseif projection="bonne":
584 vardef mercatorc(expr aa,bb)=
585 (xunit*(bb-theta),yunit*(ln(abs(tand(45+(aa/2))))-ln(abs(tand(45+(phi/2))))))
588 vardef coniquec(expr aa,bb,pc)=
589 abscon:=5*cm*(cosd(aa)*sind(bb*sind(pc)))/(sind(pc)*cosd(aa-pc));
590 ordcon:=5*cm*(cosd(aa)*cosd(bb*sind(pc)))/(sind(pc)*cosd(aa-pc));
594 vardef cylindriquec(expr aa,bb)=
595 (xunit*(bb-theta),yunit*(sind(aa)-sind(phi)))
598 vardef simplec(expr aa,bb)=
599 (xunit*(bb-theta),yunit*(aa-phi))
602 vardef bonnec(expr aaa,bbb)=
605 rho:=cotand(phi)+(phi-aaa)/c;
606 E:=(((bbb-theta)/c)*cosd(aaa))/rho;
607 tt=xunit*(rho*sind(E*c),cotand(phi)-rho*cosd(E*c));
611 vardef lecturep(expr nomfichier,fond)=
613 nbpts:=scantokens readfrom nomfichier;
618 latlon=scantokens readfrom nomfichier;
619 if projection="mercator":
620 Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60))
621 elseif projection="cylindrique":
622 Coord[k]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
623 elseif projection="simple":
624 Coord[k]=simplec(xpart(latlon/60),ypart(latlon/60));
625 elseif projection="bonne":
626 Coord[k]=bonnec(xpart(latlon/60),ypart(latlon/60));
627 elseif projection="coniqueh":
628 if (xpart(latlon)>0) or (xpart(latlon)=0):
630 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),45);
632 elseif projection="coniqueb":
633 if (xpart(latlon)<0):
635 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),-45);
639 closefrom nomfichier;
641 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
650 fill pays--cycle withcolor payscolor;
652 fill pays--cycle withcolor fond;
659 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
660 nomfichiermul:=arborescence&"Ile.dat";
662 nomfichiermul:=arborescence&"iles.dat";
664 nblec:=scantokens readfrom nomfichiermul;
665 if projection="bonne":
669 pair Coord[];color fond;
670 nbpts:=scantokens readfrom nomfichiermul;
671 fond=scantokens readfrom nomfichiermul;
676 latlon=scantokens readfrom nomfichiermul;
677 if projection="mercator":
678 Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60))
679 elseif projection="simple":
680 Coord[k]=simplec(xpart(latlon/60),ypart(latlon/60));
681 elseif projection="cylindrique":
682 Coord[k]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
683 elseif projection="bonne":
684 Coord[k]=bonnec(xpart(latlon/60),ypart(latlon/60));
685 elseif projection="coniqueh":
686 if (xpart(latlon)>0) or (xpart(latlon)=0):
688 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),45)
690 elseif projection="coniqueb":
691 if (xpart(latlon)<0):
693 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),-45);
698 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
707 fill pays--cycle withcolor payscolor;
709 fill pays--cycle withcolor fond;
714 closefrom nomfichiermul;
715 if (projection="mercator") or (projection="cylindrique") or (projection="simple"):
716 clip currentpicture to feuillet;
718 if projection="bonne":
719 lecturep(arborescence&"polesud.dat",blanc);
720 clip currentpicture to (bonnec(-90,-180) for k=-89 upto 90:..bonnec(k,-180) endfor)..reverse(bonnec(-90,180) for k=-89 upto 90:..bonnec(k,180) endfor)..cycle;
724 vardef Lecturevillesp(expr nompays)=
725 nomfichiermul:=arborescence&"villes"&nompays&".dat";
726 nblec:=scantokens readfrom nomfichiermul;
727 drawoptions(withcolor (0.15,0.15,0.15));
729 pair Coord[],latlon;string p_;
730 latlon=scantokens readfrom nomfichiermul;
731 p_=scantokens readfrom nomfichiermul;
732 if projection="mercator":
733 Coord[p]=mercatorc(ypart(latlon),xpart(latlon));
734 elseif projection="simple":
735 Coord[p]=simplec(ypart(latlon),xpart(latlon));
736 elseif projection="cylindrique":
737 Coord[p]=cylindriquec(ypart(latlon),xpart(latlon));
738 elseif projection="bonne":
739 Coord[p]=bonnec(ypart(latlon),xpart(latlon));
741 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
742 dotlabel.scantokens readfrom nomfichiermul(TEX(""&p_&""),Coord[p]);
746 closefrom nomfichiermul;
750 nomfichiermul:=arborescence&"lacs.dat";
751 nblec:=scantokens readfrom nomfichiermul;
754 nbpts:=scantokens readfrom nomfichiermul;
759 latlon=scantokens readfrom nomfichiermul;
760 if projection="mercator":
761 Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60));
762 elseif projection="simple":
763 Coord[k]=simplec(xpart(latlon/60),ypart(latlon/60));
764 elseif projection="cylindrique":
765 Coord[k]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
766 elseif projection="bonne":
767 Coord[k]=bonnec(xpart(latlon/60),ypart(latlon/60));
768 elseif projection="coniqueh":
769 if (xpart(latlon)>0) or (xpart(latlon)=0):
771 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),45);
773 elseif projection="coniqueb":
774 if (xpart(latlon)<0):
776 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),-45);
781 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
789 fill lac--cycle withcolor cielfonce;
793 closefrom nomfichiermul;
796 vardef Lecturelacspsup=
797 nomfichiermul:=arborescence&"lacssup.dat";
798 nblec:=scantokens readfrom nomfichiermul;
801 nbpts:=scantokens readfrom nomfichiermul;
806 latlon=scantokens readfrom nomfichiermul;
807 if projection="mercator":
808 Coord[k]=mercatorc(xpart(latlon),ypart(latlon));
809 elseif projection="simple":
810 Coord[k]=simplec(xpart(latlon),ypart(latlon));
811 elseif projection="cylindrique":
812 Coord[k]=cylindriquec(xpart(latlon),ypart(latlon));
813 elseif projection="bonne":
814 Coord[k]=bonnec(xpart(latlon),ypart(latlon));
815 elseif projection="coniqueh":
816 if (xpart(latlon)>0) or (xpart(latlon)=0):
818 Coord[ll]=coniquec(xpart(latlon),ypart(latlon),45);
820 elseif projection="coniqueb":
821 if (xpart(latlon)<0):
823 Coord[ll]=coniquec(xpart(latlon),ypart(latlon),-45);
828 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
836 fill lac--cycle withcolor cielfonce;
840 closefrom nomfichiermul;
843 vardef Lecturerivieresp=
844 nomfichiermul:=arborescence&"rivieres.dat";
845 nblec:=scantokens readfrom nomfichiermul;
848 nbpts:=scantokens readfrom nomfichiermul;
853 latlon=scantokens readfrom nomfichiermul;
854 if projection="mercator":
855 Coord[k]=mercatorc(xpart(latlon/60),ypart(latlon/60));
856 elseif projection="simple":
857 Coord[k]=simplec(xpart(latlon/60),ypart(latlon/60));
858 elseif projection="cylindrique":
859 Coord[k]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
860 elseif projection="bonne":
861 Coord[k]=bonnec(xpart(latlon/60),ypart(latlon/60));
862 elseif projection="coniqueh":
863 if (xpart(latlon)>0) or (xpart(latlon)=0):
865 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),45);
867 elseif projection="coniqueb":
868 if (xpart(latlon)<0):
870 Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),-45);
875 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
883 draw riv withcolor cielfonce;
886 closefrom nomfichiermul;
889 vardef Lecturerivierespsup=
890 nomfichiermul:=arborescence&"fleuveseurope.dat";
891 nblec:=scantokens readfrom nomfichiermul;
894 nbpts:=scantokens readfrom nomfichiermul;
899 latlon=scantokens readfrom nomfichiermul;
900 if projection="mercator":
901 Coord[k]=mercatorc(xpart(latlon),ypart(latlon));
902 elseif projection="simple":
903 Coord[k]=simplec(xpart(latlon),ypart(latlon));
904 elseif projection="cylindrique":
905 Coord[k]=cylindriquec(xpart(latlon),ypart(latlon));
906 elseif projection="bonne":
907 Coord[k]=bonnec(xpart(latlon),ypart(latlon));
908 elseif projection="coniqueh":
909 if (xpart(latlon)>0) or (xpart(latlon)=0):
911 Coord[ll]=coniquec(xpart(latlon),ypart(latlon),45);
913 elseif projection="coniqueb":
914 if (xpart(latlon)<0):
916 Coord[ll]=coniquec(xpart(latlon),ypart(latlon),-45);
921 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
929 draw riv withcolor cielfonce;
932 closefrom nomfichiermul;
935 vardef Lecturecapitalesp=
937 nomfichiermul:=arborescence&"capitales.dat";
938 nbcapitales:=scantokens readfrom nomfichiermul;
939 for p=1 upto nbcapitales:
942 p_=scantokens readfrom nomfichiermul;
943 latlon=scantokens readfrom nomfichiermul;
945 if projection="mercator":
946 Coord[p]=mercatorc(xpart(latlon/60),ypart(latlon/60));
948 elseif projection="simple":
949 Coord[p]=simplec(xpart(latlon/60),ypart(latlon/60));
951 elseif projection="cylindrique":
952 Coord[p]=cylindriquec(xpart(latlon/60),ypart(latlon/60));
954 elseif projection="bonne":
955 Coord[p]=bonnec(xpart(latlon/60),ypart(latlon/60));
957 elseif projection="coniqueh":
958 if (xpart(latlon)>0) or (xpart(latlon)=0):
960 Coord[p]=coniquec(xpart(latlon/60),ypart(latlon/60),45);
962 elseif projection="coniqueb":
963 if (xpart(latlon)<0):
965 Coord[p]=coniquec(xpart(latlon/60),ypart(latlon/60),-45);
969 drawoptions(withcolor rouge);
972 if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"):
973 label.top(p_,Coord[p]);
977 closefrom nomfichiermul;
981 vardef MeridienParallele=
982 if (projection="mercator") or (projection="cylindrique") or (projection="simple"):
984 for k=-80 step 10 until 80:
985 for j=-180 step 10 until 180:
986 if projection="mercator":
987 Coord[100*k+j]=mercatorc(k,j);
988 elseif projection="simple":
989 Coord[k]=simplec(k,j);
990 elseif projection="cylindrique":
991 Coord[100*k+j]=cylindriquec(k,j);
995 for k=-80 step 10 until 80:
996 draw Coord[100*k-180]
997 for j=-170 step 10 until 180:
1002 for k=-180 step 10 until 180:
1003 for j=-80 step 10 until 80:
1004 if projection="mercator":
1005 Coord[0.001*k+10*j]=mercatorc(j,k);
1006 elseif projection="simple":
1007 Coord[k]=simplec(j,k);
1008 elseif projection="cylindrique":
1009 Coord[0.001*k+10*j]=cylindriquec(j,k);
1013 for k=-180 step 10 until 180:
1014 draw Coord[0.001*k-10*80]
1015 for j=-70 step 10 until 80:
1016 --Coord[0.001*k+10*j]
1019 elseif projection="bonne":
1021 for k=-90 step 10 until 90:
1022 for j=-180 step 10 until 180:
1023 Coord[k][j]=bonnec(k,j);
1026 for k=-90 step 10 until 90:
1028 for j=-170 step 10 until 180:
1033 for k=-170 step 10 until 170:
1034 for j=-90 step 10 until 90:
1035 Coord[k][j]=bonnec(j,k);
1038 for k=-170 step 10 until 170:
1040 for j=-80 step 10 until 90:
1044 elseif projection="coniqueh":
1046 for k=-180 step 10 until 180:
1047 for j=0 step 10 until 90:
1048 Coord[100*k+j]=coniquec(j,k,45);
1051 for k=-180 step 10 until 180:
1053 for j=10 step 10 until 90:
1058 for k=0 step 10 until 90:
1059 for j=-180 step 10 until 180:
1060 Coord[0.001*k+10*j]=coniquec(k,j,45);
1063 for k=0 step 10 until 90:
1064 draw Coord[0.001*k-10*180]
1065 for j=-170 step 10 until 180:
1066 --Coord[0.001*k+10*j]
1069 clip currentpicture to coniquec(90,0,45)--(Coord[-10*180]
1070 for j=-170 step 10 until 180:
1073 elseif projection="coniqueb":
1075 for k=-180 step 10 until 180:
1076 for j=-90 step 10 until 0:
1077 Coord[100*k+j]=coniquec(j,k,-45);
1080 for k=-180 step 10 until 180:
1081 draw Coord[100*k-90]
1082 for j=-80 step 10 until 0:
1087 for k=-90 step 10 until 0:
1088 for j=-180 step 10 until 180:
1089 Coord[0.001*k+10*j]=coniquec(k,j,-45);
1092 for k=-90 step 10 until 0:
1093 draw Coord[0.001*k-10*180]
1094 for j=-170 step 10 until 180:
1095 --Coord[0.001*k+10*j]
1098 clip currentpicture to coniquec(-90,0,-45)--(Coord[-10*180]
1099 for j=-170 step 10 until 180:
1108 vardef echelle(expr Th,Ph,long)=%long en km.
1115 if projection="bonne":
1116 $=(cm*pi*cosd(Ph)*6340/36)/(long*abs(bonnec(Ph,Th)-bonnec(Ph,Th+5)));
1117 elseif projection="mercator":
1118 $=(cm*pi*cosd(Ph)*6340/36)/(long*abs(mercatorc(Ph,Th)-mercatorc(Ph,Th+5)));
1119 elseif projection="simple":
1120 $=(cm*pi*cosd(Ph)*6340/36)/(long*abs(simplec(Ph,Th)-simplec(Ph,Th+5)));
1121 elseif projection="cylindrique":
1122 $=(cm*pi*cosd(Ph)*6340/36)/(long*abs(cylindriquec(Ph,Th)-cylindriquec(Ph,Th+5)));
1127 boolean Amsud,Amnord,Amcentrale,Caraibes,Asie,Europe,Afrique,All;
1138 vardef Projection(expr TH,PH,Zoom)=
1142 if projection="bonne":
1143 fill (bonnec(-90,-180) for k=-85 step 5 until 90:..bonnec(k,-180) endfor)..reverse(bonnec(-90,180) for k=-85 step 5 until 90:..bonnec(k,180) endfor)..cycle withcolor ciel;
1146 Lecture("Cameriquesud.dat");
1147 Lecture("Ccaraibes.dat");
1148 Lecture("Cameriquecentrale.dat");
1149 Lecture("Cameriquenord.dat");
1150 Lecture("Casia.dat");
1151 Lecture("Ceurope.dat");
1152 Lecture("Cafrique.dat");
1155 Lecture("Cameriquesud.dat");
1158 Lecture("Cameriquenord.dat");
1161 Lecture("Cameriquecentrale.dat");
1164 Lecture("Ccaraibes.dat");
1167 if projection="bonne":
1168 Lecture("Casie.dat");
1170 Lecture("Casia.dat");
1174 Lecture("Ceurope.dat");
1177 Lecture("Cafrique.dat");
1190 Lecturerivierespsup;
1193 drawoptions(withcolor gris);
1198 draw ((Xa,Ya)+u*(1,1))--((Xa,Ya)+u*(2,1));
1199 labeloffset:=labeloffset*1.5;
1200 label.top(btex 0 etex,(Xa,Ya)+u*(1,1));
1201 label.top(TEX(""&decimal(Long)&"~km"),(Xa,Ya)+u*(2,1));
1202 labeloffset:=labeloffset/1.5;
1203 draw ((Xa,Ya)+u*(1,1.1))--((Xa,Ya)+u*(1,0.9));
1204 draw (((Xa,Ya)+u*(1,1.1))--((Xa,Ya)+u*(1,0.9))) shifted(u*(1,0));
1208 vardef Simple(expr TH,PH,Zoom)=
1209 projection:="simple";
1213 Lecture("Cameriquesud.dat");
1214 Lecture("Ccaraibes.dat");
1215 Lecture("Cameriquecentrale.dat");
1216 Lecture("Cameriquenord.dat");
1217 Lecture("Casia.dat");
1218 Lecture("Ceurope.dat");
1219 Lecture("Cafrique.dat");
1236 vardef Mercator(expr TH,PH,Zoom)=
1237 projection:="mercator";
1241 Lecture("Cameriquesud.dat");
1242 Lecture("Ccaraibes.dat");
1243 Lecture("Cameriquecentrale.dat");
1244 Lecture("Cameriquenord.dat");
1245 Lecture("Casia.dat");
1246 Lecture("Ceurope.dat");
1247 Lecture("Cafrique.dat");
1264 vardef Cylindrique(expr TH,PH,Zoom)=
1265 projection:="cylindrique";
1269 Lecture("Cameriquesud.dat");
1270 Lecture("Ccaraibes.dat");
1271 Lecture("Cameriquecentrale.dat");
1272 Lecture("Cameriquenord.dat");
1273 Lecture("Casia.dat");
1274 Lecture("Ceurope.dat");
1275 Lecture("Cafrique.dat");
1292 vardef Bonne(expr TH,PH,Zoom)=
1293 projection:="bonne";
1297 fill (bonnec(-90,-180) for k=-85 step 5 until 90:..bonnec(k,-180) endfor)..reverse(bonnec(-90,180) for k=-85 step 5 until 90:..bonnec(k,180) endfor)..cycle withcolor ciel;
1298 Lecture("Cameriquesud.dat");
1299 Lecture("Ccaraibes.dat");
1300 Lecture("Cameriquecentrale.dat");
1301 Lecture("Cameriquenord.dat");
1302 Lecture("Casie.dat");
1303 Lecture("Ceurope.dat");
1304 Lecture("Cafrique.dat");
1317 drawoptions(withcolor gris);
1321 draw (bonnec(-90,-180) for k=-85 step 5 until 90:..bonnec(k,-180) endfor)..reverse(bonnec(-90,180) for k=-85 step 5 until 90:..bonnec(k,180) endfor)..cycle;
1325 projection:="coniqueh";
1326 Lecture("Cameriquesud.dat");
1327 Lecture("Ccaraibes.dat");
1328 Lecture("Cameriquecentrale.dat");
1329 Lecture("Cameriquenord.dat");
1330 Lecture("Casie.dat");
1331 Lecture("Ceurope.dat");
1332 Lecture("Cafrique.dat");
1343 Lecturerivierespsup;
1345 drawoptions(withcolor gris);
1351 projection:="coniqueb";
1352 Lecture("Cameriquesud.dat");
1353 Lecture("Ccaraibes.dat");
1354 Lecture("Cameriquecentrale.dat");
1355 Lecture("Cameriquenord.dat");
1356 Lecture("Casie.dat");
1357 Lecture("Ceurope.dat");
1358 Lecture("Cafrique.dat");
1369 Lecturerivierespsup;
1371 drawoptions(withcolor gris);
1380 boolean fleuves,lacs,capitales,noncolore,maillage,volcans;
1388 vardef Mappemonde(expr longobs,latobs)=
1390 figureespace(-100u,-100u,100u,100u);
1391 Initialisation(5,longobs,latobs,750);
1392 numeric phim,phip,phii;%phi moins -- phi plus - phi intermédiaire
1393 phim=Phi+arcsind(rayon/Rho)-90;
1394 phip=Phi+90-arcsind(rayon/Rho);
1396 pte1=rayon*(cosd(phim)*cosd(Theta),cosd(phim)*sind(Theta),sind(phim));
1397 pte2=rayon*(cosd(phip)*cosd(Theta),cosd(phip)*sind(Theta),sind(phip));
1398 pte3=1/2[pte1,pte2];
1399 pte4-pte3=Normal((0,0,0),pte1,pte2);
1412 fill cercles(pte3,pte1,pte3,pte1,pte4) withcolor ciel;
1413 Lecture("Cameriquesud.dat");
1414 Lecture("Ccaraibes.dat");
1415 Lecture("Cameriquecentrale.dat");
1416 Lecture("Cameriquenord.dat");
1417 Lecture("Casie.dat");
1418 Lecture("Ceurope.dat");
1419 Lecture("Cafrique.dat");
1433 %Lecturerivieressup;
1436 drawoptions(withcolor gris);
1443 draw cercles(pte3,pte1,pte3,pte1,pte4);