Mobdification de Courbe en CourbeDat dans gdd.mp, ajout des variable gddXlabel et...
[mp-gdd.git] / exemples / polaires / pol02.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+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,5,3.5,3.5);
31  Axes; 
32  Debut; 
33   Graduations; Unites(1);
34
35   drawoptions(withcolor LightSlateGrey);
36
37   draw fullcircle shifted (0.5,0) gddEnPlace avecCrayon(1,Gold);
38
39   nb = 80;
40   pas = 2Pi / nb;
41   for i=0 upto nb:
42     theta := i * pas;
43     draw (fullcircle scaled 2cos(theta) 
44       shifted (cos(theta)*cos(theta),cos(theta)*sin(theta))) gddEnPlace;
45   endfor;
46
47
48   traceDoubleVecteur(rp(0),(0,0.3)) avecCrayon(1,LightPink);
49   traceDoubleVecteur(rp(Pi/3),(0.3,0)) avecCrayon(1,LightPink);
50   traceDoubleVecteur(rp(Pi/2),(0.2,0.2)) avecCrayon(1,LightPink);
51   traceDoubleVecteur(rp(2Pi/3),(0,0.3)) avecCrayon(1,LightPink);
52   traceDoubleVecteur(rp(-Pi/3),(0.3,0)) avecCrayon(1,LightPink);
53   traceDoubleVecteur(rp(-Pi/2),(0.2,-0.2)) avecCrayon(1,LightPink);
54   traceDoubleVecteur(rp(-2Pi/3),(0,0.3)) avecCrayon(1,LightPink);
55
56   trace Vecteur(origine,(-0.3,0)) avecCrayon(1,LightPink);
57   trace CourbeEnPolaires(r,-Pi,Pi,100) avecCrayon(1.5,Indigo);
58
59   pointe Point(0,0);
60   pointe Point(2,0);
61   pointe PairTOPoint(rp(Pi/3));
62   pointe PairTOPoint(rp(-Pi/3));
63   pointe PairTOPoint(rp(2Pi/3));
64   pointe PairTOPoint(rp(-2Pi/3));
65   pointe Point(0,1);
66   pointe Point(0,-1);
67
68   label.urt(TEX("\(\mathcal{C}\)"),PtR(Point(1,0))) withcolor Magenta;
69  Fin;
70
71
72 endfig;
73
74 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.