+
+%
+% 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;