Mobdification de Courbe en CourbeDat dans gdd.mp, ajout des variable gddXlabel et...
[mp-gdd.git] / gdd-plt.mp
index 8e8d288..4a64056 100644 (file)
@@ -24,7 +24,7 @@ enddef;
 vardef CourbeEnPolaires(suffix r)(expr ti,tf,n) =
     save fpas,t;
     fpas := (tf-ti)/n;
 vardef CourbeEnPolaires(suffix r)(expr ti,tf,n) =
     save fpas,t;
     fpas := (tf-ti)/n;
-    r(ti)*(cos(ti),sin(ti)) 
+    r(ti)*(cos(ti),sin(ti))
     for i=1 upto n: hide(t:=ti+i*fpas) .. r(t)*(cos(t),sin(t)) endfor
 enddef;
 
     for i=1 upto n: hide(t:=ti+i*fpas) .. r(t)*(cos(t),sin(t)) endfor
 enddef;
 
@@ -48,13 +48,13 @@ vardef ChampVecteurs(suffix f)(expr x,y,px,py,dx,couleur) =
   endfor
   for i = 0 upto (repXmax - x)/px:
      for j = 0 upto (y - repYmin)/py:
   endfor
   for i = 0 upto (repXmax - x)/px:
      for j = 0 upto (y - repYmin)/py:
-       drawarrow 
+       drawarrow
         (((0,0)--dx*unitvector((1,f(x+i*px,y-j*py))))
                  shifted (x+i*px,y-j*px)) gddEnPlace
                  withcolor couleur;
      endfor
      for j = 0 upto (repYmax - y)/py:
         (((0,0)--dx*unitvector((1,f(x+i*px,y-j*py))))
                  shifted (x+i*px,y-j*px)) gddEnPlace
                  withcolor couleur;
      endfor
      for j = 0 upto (repYmax - y)/py:
-       drawarrow 
+       drawarrow
         (((0,0)--dx*unitvector((1,f(x+i*px,y+j*py))))
                  shifted (x+i*px,y+j*py)) gddEnPlace
                  withcolor couleur;
         (((0,0)--dx*unitvector((1,f(x+i*px,y+j*py))))
                  shifted (x+i*px,y+j*py)) gddEnPlace
                  withcolor couleur;
@@ -62,4 +62,39 @@ vardef ChampVecteurs(suffix f)(expr x,y,px,py,dx,couleur) =
   endfor
 enddef;
 
   endfor
 enddef;
 
-endinput;
\ No newline at end of file
+
+%
+% Champs de vecteurs f R^2 -> R^2
+% ------------------------------------------------------------------------------
+vardef ChampVecteursDD(suffix f)(expr x,y,px,py,dx,couleur) =
+  for i = 0 upto (x - repXmin)/px:
+     for j = 0 upto (y - repYmin)/py:
+       drawarrow
+        (((0,0)--dx*unitvector(f(x-i*px,y-j*py)))
+                 shifted (x-i*px,y-j*py)) gddEnPlace
+                 withcolor couleur;
+     endfor
+     for j = 0 upto (repYmax - y)/py:
+       drawarrow
+        (((0,0)--dx*unitvector(f(x-i*px,y+j*py)))
+                 shifted (x-i*px,y+j*py)) gddEnPlace
+                 withcolor couleur;
+     endfor
+  endfor
+  for i = 0 upto (repXmax - x)/px:
+     for j = 0 upto (y - repYmin)/py:
+       drawarrow
+        (((0,0)--dx*unitvector(f(x+i*px,y-j*py)))
+                 shifted (x+i*px,y-j*px)) gddEnPlace
+                 withcolor couleur;
+     endfor
+     for j = 0 upto (repYmax - y)/py:
+       drawarrow
+        (((0,0)--dx*unitvector(f(x+i*px,y+j*py)))
+                 shifted (x+i*px,y+j*py)) gddEnPlace
+                 withcolor couleur;
+     endfor
+  endfor
+enddef;
+
+endinput;

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.