1 if unknown Pi: input gdd-fct; fi;
2 if unknown repSavePict: input gdd-rep; fi;
6 % ------------------------------------------------------------------------------
7 vardef Courbe(suffix fx)(suffix fy)(expr ti,tf,n) =
8 save fpas; fpas := (tf-ti)/n;
9 (fx(ti),fy(ti)) for i=1 upto n: ..(fx(ti+i*fpas),fy(ti+i*fpas)) endfor
13 % Représentation de fonction
14 % ------------------------------------------------------------------------------
15 vardef Representation(suffix f)(expr ti,tf,n) =
18 (ti,f(ti)) for i=1 upto n: ..(ti+i*fpas,f(ti+i*fpas)) endfor
23 % ------------------------------------------------------------------------------
24 vardef CourbeEnPolaires(suffix r)(expr ti,tf,n) =
27 r(ti)*(cos(ti),sin(ti))
28 for i=1 upto n: hide(t:=ti+i*fpas) .. r(t)*(cos(t),sin(t)) endfor
33 % ------------------------------------------------------------------------------
34 vardef ChampVecteurs(suffix f)(expr x,y,px,py,dx,couleur) =
35 for i = 0 upto (x - repXmin)/px:
36 for j = 0 upto (y - repYmin)/py:
38 (((0,0)--dx*unitvector((1,f(x-i*px,y-j*py))))
39 shifted (x-i*px,y-j*py)) gddEnPlace
42 for j = 0 upto (repYmax - y)/py:
44 (((0,0)--dx*unitvector((1,f(x-i*px,y+j*py))))
45 shifted (x-i*px,y+j*py)) gddEnPlace
49 for i = 0 upto (repXmax - x)/px:
50 for j = 0 upto (y - repYmin)/py:
52 (((0,0)--dx*unitvector((1,f(x+i*px,y-j*py))))
53 shifted (x+i*px,y-j*px)) gddEnPlace
56 for j = 0 upto (repYmax - y)/py:
58 (((0,0)--dx*unitvector((1,f(x+i*px,y+j*py))))
59 shifted (x+i*px,y+j*py)) gddEnPlace
67 % Champs de vecteurs f R^2 -> R^2
68 % ------------------------------------------------------------------------------
69 vardef ChampVecteursDD(suffix f)(expr x,y,px,py,dx,couleur) =
70 for i = 0 upto (x - repXmin)/px:
71 for j = 0 upto (y - repYmin)/py:
73 (((0,0)--dx*unitvector(f(x-i*px,y-j*py)))
74 shifted (x-i*px,y-j*py)) gddEnPlace
77 for j = 0 upto (repYmax - y)/py:
79 (((0,0)--dx*unitvector(f(x-i*px,y+j*py)))
80 shifted (x-i*px,y+j*py)) gddEnPlace
84 for i = 0 upto (repXmax - x)/px:
85 for j = 0 upto (y - repYmin)/py:
87 (((0,0)--dx*unitvector(f(x+i*px,y-j*py)))
88 shifted (x+i*px,y-j*px)) gddEnPlace
91 for j = 0 upto (repYmax - y)/py:
93 (((0,0)--dx*unitvector(f(x+i*px,y+j*py)))
94 shifted (x+i*px,y+j*py)) gddEnPlace