Changeset 37

Show
Ignore:
Timestamp:
03/14/08 22:45:46 (8 months ago)
Author:
christophe
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mp-geo/docpdf.tex

    r9 r37  
    139139  un problème d'accès direct à des pays comme Cuba ou l'Australie. Un 
    140140  autre souci à régler\ldots}. Enfin les lacs sont regroupés dans un 
    141 seul fichier ainsi que pour les fleuves et rivières. 
    142 \\\`A noter que les lacs, les fleuves et les capitales sont {\em 
    143   optionnels}; leur affichage est fait par défaut sauf pour 
    144 \verb!capitales!; mais l'utilisateur peut en décider autrement en 
    145 changeant les paramètres \verb!lacs!, \verb!fleuves! et 
    146 \verb!capitales! à \verb!false!. Ceci peut être non négligeable lors 
    147 de la mesure du temps de compilation. Par exemple, le temps de 
     141seul fichier ainsi que pour les fleuves et rivières et les 
     142volcans\footnote{Ce sont les 813 volcans qui ont eu une éruption ces 
     143  10\,000 dernières années.}. 
     144\\\`A noter que les lacs, les fleuves, les capitales et les volcans 
     145sont {\em optionnels}; leur affichage est fait par défaut sauf pour 
     146les capitales et volcans; mais l'utilisateur peut en décider 
     147autrement en changeant les paramètres \verb!lacs!, \verb!fleuves!, 
     148\verb!capitales! et \verb!volcans! à \verb!false!. Ceci peut être non 
     149négligeable lors de la mesure du temps de compilation. Par exemple, le temps de 
    148150compilation de la figure \ding{172} a été de 37~s alors que pour la 
    149151figure \ding{173}, la compilation a duré 27~s. 
     
    269271  \includegraphics[scale=0.7]{polesud} 
    270272  \caption{L'immensité du pôle sud ($\theta=0$; $\phi=90$\degres).} 
     273\end{figure} 
     274Ooops ! une petite dernière\ldots\footnote{Ne cherchez pas après les 
     275  fonctionnalités pour la transparence, elles ne sont pas implémentées 
     276  dans le package; elles ne sont valables que dans des cas 
     277  particuliers\ldots} 
     278\begin{figure}[ht] 
     279  \centering 
     280  \includegraphics{globetransparent.png} 
     281  \caption{Un peu de transparence.} 
    271282\end{figure} 
    272283\section{Projections planes} 
     
    454465\section{Historique} 
    455466\begin{description} 
     467\item[14/03/2008] Version \texttt{0.58} : Ajout de fleuves et lacs 
     468  supplémentaires. 
     469\item[14/03/2008] Version \texttt{0.56} : Ajout des volcans :). 
    456470\item[18/02/2008] Version \texttt{0.55} : Ajout des projections de Bonne. 
    457471\item[18/02/2008] Version \texttt{0.54} : Modification mineure dans la 
  • trunk/mp-geo/mp-geo.mp

    r11 r37  
    3131tan=(0.824,0.705,0.55); 
    3232payscolor=tan; 
     33 
     34vardef 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 
     35enddef; 
    3336 
    3437%Les marques 
     
    348351enddef; 
    349352 
    350  
    351353vardef Lecturelacs= 
    352354  nomfichiermul:=arborescence&"lacs.dat"; 
     
    386388enddef; 
    387389 
     390vardef Lecturelacssup= 
     391  nomfichiermul:=arborescence&"lacssup.dat"; 
     392  nblec:=scantokens readfrom nomfichiermul; 
     393  for p=1 upto nblec: 
     394    color Coord[],Pays[]; 
     395    numeric ll; 
     396    ll:=0; 
     397    nbpts:=scantokens readfrom nomfichiermul; 
     398    for k=1 upto nbpts: 
     399      pair latlon; 
     400      latlon=scantokens readfrom nomfichiermul; 
     401      Coord[k]=rayon*(cosd(xpart(latlon))*cosd(ypart(latlon)),cosd(xpart(latlon))*sind(ypart(latlon)),sind(xpart(latlon))); 
     402      if ((xpart(latlon)>phim) and (xpart(latlon)<phip)): 
     403        if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0: 
     404          ll:=ll+1; 
     405          Pays[k]=Coord[k]; 
     406        else: 
     407          Pays[k]=2*Coord[k]; 
     408        fi; 
     409      else: 
     410        Pays[k]=2*Coord[k]; 
     411      fi; 
     412    endfor; 
     413    path pays; 
     414    if ll>0: 
     415      pays=Projgeo(Pays[1]) 
     416      for l=2 upto nbpts: 
     417        --Projgeo(Pays[l]) 
     418      endfor; 
     419      fill pays--cycle withcolor cielfonce; 
     420      draw pays; 
     421      clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4); 
     422    fi; 
     423  endfor; 
     424  closefrom nomfichiermul; 
     425enddef; 
     426 
     427vardef Lecturevolcans= 
     428  drawoptions(withcolor orange); 
     429  nomfichiermul:=arborescence&"volcans.dat"; 
     430  nblec:=scantokens readfrom nomfichiermul; 
     431  show nblec; 
     432  for p=1 upto nblec: 
     433    color Coord[],Pays[]; 
     434    pair latlon; 
     435    latlon=scantokens readfrom nomfichiermul; 
     436    Coord[p]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60))); 
     437    if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)): 
     438      if ProduitScalaire(Coord[p]-pte3,Oeil-pte3)>0: 
     439        Pays[p]=Coord[p]; 
     440        fill flamme shifted Projgeo(Pays[p]) withcolor 1/2[orange,jaune]; 
     441      %else: 
     442%       Pays[k]=2*Coord[k]; 
     443      fi; 
     444%    else: 
     445%      Pays[k]=2*Coord[k]; 
     446    fi; 
     447  endfor; 
     448closefrom nomfichiermul; 
     449drawoptions(); 
     450enddef; 
     451 
    388452vardef Lecturerivieres= 
    389453  nomfichiermul:=arborescence&"rivieres.dat"; 
     
    399463      Coord[k]=rayon*(cosd(xpart(latlon/60))*cosd(ypart(latlon/60)),cosd(xpart(latlon/60))*sind(ypart(latlon/60)),sind(xpart(latlon/60))); 
    400464      if ((xpart(latlon/60)>phim) and (xpart(latlon/60)<phip)): 
     465        if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0: 
     466          ll:=ll+1; 
     467          Pays[k]=Coord[k]; 
     468        else: 
     469          Pays[k]=2*Coord[k]; 
     470        fi; 
     471      else: 
     472        Pays[k]=2*Coord[k]; 
     473      fi; 
     474    endfor; 
     475    path pays; 
     476    if ll>0: 
     477      pays=Projgeo(Pays[1]) 
     478      for l=2 upto nbpts: 
     479        --Projgeo(Pays[l]) 
     480      endfor; 
     481      draw pays withcolor cielfonce; 
     482      clip currentpicture to cercles(pte3,pte1,pte3,pte1,pte4); 
     483    fi; 
     484  endfor; 
     485  closefrom nomfichiermul; 
     486enddef; 
     487 
     488vardef Lecturerivieressup= 
     489  nomfichiermul:=arborescence&"fleuvessup.dat"; 
     490  nblec:=scantokens readfrom nomfichiermul; 
     491  for p=1 upto nblec: 
     492    color Coord[],fond,Pays[]; 
     493    numeric ll; 
     494    ll:=0; 
     495    nbpts:=scantokens readfrom nomfichiermul; 
     496    for k=1 upto nbpts: 
     497      pair latlon; 
     498      latlon=scantokens readfrom nomfichiermul; 
     499      Coord[k]=rayon*(cosd(xpart(latlon))*cosd(ypart(latlon)),cosd(xpart(latlon))*sind(ypart(latlon)),sind(xpart(latlon))); 
     500      if ((xpart(latlon)>phim) and (xpart(latlon)<phip)): 
    401501        if ProduitScalaire(Coord[k]-pte3,Oeil-pte3)>0: 
    402502          ll:=ll+1; 
     
    697797enddef; 
    698798 
     799vardef Lecturelacspsup= 
     800  nomfichiermul:=arborescence&"lacssup.dat"; 
     801  nblec:=scantokens readfrom nomfichiermul; 
     802  for p=1 upto nblec: 
     803    pair Coord[]; 
     804    nbpts:=scantokens readfrom nomfichiermul; 
     805    numeric ll; 
     806    ll=0; 
     807    for k=1 upto nbpts: 
     808      pair latlon; 
     809      latlon=scantokens readfrom nomfichiermul; 
     810      if projection="mercator": 
     811        Coord[k]=mercatorc(xpart(latlon),ypart(latlon)); 
     812      elseif projection="simple": 
     813        Coord[k]=simplec(xpart(latlon),ypart(latlon)); 
     814      elseif projection="cylindrique": 
     815        Coord[k]=cylindriquec(xpart(latlon),ypart(latlon)); 
     816      elseif projection="bonne": 
     817        Coord[k]=bonnec(xpart(latlon),ypart(latlon)); 
     818      elseif projection="coniqueh": 
     819        if (xpart(latlon)>0) or (xpart(latlon)=0): 
     820          ll:=ll+1; 
     821          Coord[ll]=coniquec(xpart(latlon),ypart(latlon),45); 
     822        fi; 
     823      elseif projection="coniqueb": 
     824        if (xpart(latlon)<0): 
     825          ll:=ll+1; 
     826          Coord[ll]=coniquec(xpart(latlon),ypart(latlon),-45); 
     827        fi; 
     828      fi; 
     829    endfor; 
     830    path lac; 
     831    if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"): 
     832      ll:=nbpts 
     833    fi; 
     834    if ll>0: 
     835      lac=Coord[1] 
     836      for l=2 upto ll: 
     837        --Coord[l] 
     838      endfor; 
     839      fill lac--cycle withcolor cielfonce; 
     840      draw lac; 
     841    fi; 
     842  endfor; 
     843  closefrom nomfichiermul; 
     844enddef; 
     845 
    699846vardef Lecturerivieresp= 
    700847  nomfichiermul:=arborescence&"rivieres.dat"; 
     
    725872          ll:=ll+1; 
    726873          Coord[ll]=coniquec(xpart(latlon/60),ypart(latlon/60),-45); 
     874        fi; 
     875      fi; 
     876    endfor; 
     877    path riv; 
     878    if (projection="mercator") or (projection="cylindrique") or (projection="simple") or (projection="bonne"): 
     879      ll:=nbpts; 
     880    fi; 
     881    if ll>0: 
     882      riv=Coord[1] 
     883      for l=2 upto ll: 
     884        --Coord[l] 
     885      endfor; 
     886      draw riv withcolor cielfonce; 
     887    fi; 
     888  endfor; 
     889  closefrom nomfichiermul; 
     890enddef; 
     891 
     892vardef Lecturerivierespsup= 
     893  nomfichiermul:=arborescence&"fleuvessup.dat"; 
     894  nblec:=scantokens readfrom nomfichiermul; 
     895  for p=1 upto nblec: 
     896    pair Coord[]; 
     897    nbpts:=scantokens readfrom nomfichiermul; 
     898    numeric ll; 
     899    ll:=0; 
     900    for k=1 upto nbpts: 
     901      pair latlon; 
     902      latlon=scantokens readfrom nomfichiermul; 
     903      if projection="mercator": 
     904        Coord[k]=mercatorc(xpart(latlon),ypart(latlon)); 
     905      elseif projection="simple": 
     906        Coord[k]=simplec(xpart(latlon),ypart(latlon)); 
     907      elseif projection="cylindrique": 
     908        Coord[k]=cylindriquec(xpart(latlon),ypart(latlon)); 
     909      elseif projection="bonne": 
     910        Coord[k]=bonnec(xpart(latlon),ypart(latlon)); 
     911      elseif projection="coniqueh": 
     912        if (xpart(latlon)>0) or (xpart(latlon)=0): 
     913          ll:=ll+1; 
     914          Coord[ll]=coniquec(xpart(latlon),ypart(latlon),45); 
     915        fi; 
     916      elseif projection="coniqueb": 
     917        if (xpart(latlon)<0): 
     918          ll:=ll+1; 
     919          Coord[ll]=coniquec(xpart(latlon),ypart(latlon),-45); 
    727920        fi; 
    728921      fi; 
     
    9271120  if lacs=true: 
    9281121    Lecturelacsp; 
     1122    Lecturelacspsup; 
    9291123  fi; 
    9301124  Lectureilesp; 
     
    9341128  if fleuves=true: 
    9351129    Lecturerivieresp; 
     1130    Lecturerivierespsup; 
    9361131  fi; 
    9371132  if maillage=true: 
     
    9541149  if lacs=true: 
    9551150    Lecturelacsp; 
     1151    Lecturelacspsup; 
    9561152  fi; 
    9571153  Lectureilesp; 
     
    9611157  if fleuves=true: 
    9621158    Lecturerivieresp; 
     1159    Lecturerivierespsup; 
    9631160  fi; 
    9641161  if maillage=true: 
     
    9811178  if lacs=true: 
    9821179    Lecturelacsp; 
     1180    Lecturelacspsup; 
    9831181  fi; 
    9841182  Lectureilesp; 
     
    9881186  if fleuves=true: 
    9891187    Lecturerivieresp; 
     1188    Lecturerivierespsup; 
    9901189  fi; 
    9911190  if maillage=true: 
     
    10091208  if lacs=true: 
    10101209    Lecturelacsp; 
     1210    Lecturelacspsup; 
    10111211  fi; 
    10121212  Lectureilesp; 
     
    10161216  if fleuves=true: 
    10171217    Lecturerivieresp; 
     1218    Lecturerivierespsup; 
    10181219  fi; 
    10191220  if maillage=true: 
     
    10361237  if lacs=true: 
    10371238    Lecturelacsp; 
     1239    Lecturelacspsup; 
    10381240  fi; 
    10391241  Lectureilesp; 
     
    10431245  if fleuves=true: 
    10441246    Lecturerivieresp; 
     1247    Lecturerivierespsup; 
    10451248  fi; 
    10461249  drawoptions(withcolor gris); 
     
    10601263  if lacs=true: 
    10611264    Lecturelacsp; 
     1265    Lecturelacspsup; 
    10621266  fi; 
    10631267  Lectureilesp; 
     
    10671271  if fleuves=true: 
    10681272    Lecturerivieresp; 
     1273    Lecturerivierespsup; 
    10691274  fi; 
    10701275  drawoptions(withcolor gris); 
     
    10771282rayon:=2; 
    10781283 
    1079 boolean fleuves,lacs,capitales,noncolore,maillage
     1284boolean fleuves,lacs,capitales,noncolore,maillage,volcans
    10801285fleuves=true; 
    10811286lacs=true; 
     
    10831288noncolore=false; 
    10841289maillage=false; 
     1290volcans=false; 
    10851291 
    10861292vardef Mappemonde(expr longobs,latobs)= 
     
    11161322  Lecture("Ceurope.dat"); 
    11171323  Lecture("Cafrique.dat"); 
     1324  if volcans=true: 
     1325    Lecturevolcans; 
     1326  fi; 
    11181327  if lacs=true: 
    11191328    Lecturelacs; 
     1329    Lecturelacssup; 
    11201330  fi; 
    11211331  Lectureiles; 
     
    11251335  if fleuves=true: 
    11261336    Lecturerivieres; 
     1337    Lecturerivieressup; 
    11271338  fi; 
    11281339  if maillage=true: