Mobdification de Courbe en CourbeDat dans gdd.mp, ajout des variable gddXlabel et...
[mp-gdd.git] / exemples / polaires / pol03.mp
1 input gdd;
2 input gdd-rep;
3 input gdd-lbl;
4 input gdd-tra;
5 input svgnames;
6
7 lblPreambule := "\usepackage[frenchb]{babel}"       &
8                 "\usepackage[garamond]{mathdesign}" &
9                 "\usepackage{amsmath}";
10
11 input gdd-fct;
12 input gdd-plt;
13
14 labeloffset := 6;
15 gddU:=1.2cm;
16
17 vardef r(expr t) = 1+2*cos(t) enddef;
18
19 vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef;
20
21 def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef;
22
23 def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef;
24
25
26
27 beginfig(1);
28
29
30  Repere(10,10,2.2,5,2,2);
31  Axes; 
32  Debut; 
33   Graduations; Unites(1);
34
35   drawoptions(withcolor LightSlateGrey);
36
37   nb = 50;
38   pas = 4 / nb;
39   for i=1 upto nb:
40     vardef rt(expr t) = 1 + (-1+i*pas)*cos(t) enddef;
41     trace CourbeEnPolaires(rt,-Pi,Pi,100) withcolor ((i/nb)[Gainsboro,Chartreuse]);
42   endfor;
43
44   trace CourbeEnPolaires(r,-Pi,Pi,100) avecCrayon(1.5,LightSeaGreen);
45
46   pointe Point(0,0);
47   pointe Point(0,1);
48   pointe Point(0,-1);
49
50  Fin;
51
52
53 endfig;
54
55 end

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.