Mobdification de Courbe en CourbeDat dans gdd.mp, ajout des variable gddXlabel et...
[mp-gdd.git] / exemples / polaires / pol04.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) = cos(2t)+cos(t)*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 a = arccos(1/sqrt(3));
27
28
29
30 beginfig(1);
31
32
33  Repere(10,8,5,4,2,2);
34  Axes; 
35  Debut; 
36   Graduations; Unites(1);
37
38   drawoptions(withcolor LightBlue);
39
40   nb = 60;
41   pas = 2Pi/ nb;
42   for i:=0 upto nb:
43     trace (0,0) -- rp(i*pas);
44   endfor;
45
46   traceDoubleVecteur((0,0),0.5(cos(a),sin(a))) avecCrayon(1,MediumVioletRed);
47   traceDoubleVecteur((0,0),0.5(-cos(a),sin(a))) avecCrayon(1,MediumVioletRed);
48   traceDoubleVecteur((2,0),(0,0.5)) avecCrayon(1,MediumVioletRed);
49   traceDoubleVecteur((-2,0),(0,0.5)) avecCrayon(1,MediumVioletRed);
50   traceDoubleVecteur((0,1),(0.5,0)) avecCrayon(1,MediumVioletRed);
51   traceDoubleVecteur((0,-1),(-0.5,0)) avecCrayon(1,MediumVioletRed);
52
53   trace CourbeEnPolaires(r,-Pi,Pi,150) avecCrayon(1.5,DarkOliveGreen);
54
55   pointe Point(0,0);
56   pointe Point(0,1);
57   pointe Point(0,-1);
58   pointe Point(2,0);
59   pointe Point(-2,0);
60
61  Fin;
62
63
64 endfig;
65
66 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.