Documentation : section Objectif plus couleurs
[mp-gdd.git] / exemples / courbes / cp01.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 f(expr t) = 2*cos(t)*cos(t)*cos(t) enddef;
18 vardef g(expr t) = 2*sin(t)*sin(t)*sin(t) enddef;
19
20 def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef;
21
22
23
24 beginfig(1);
25
26
27  Repere(8,8,4,4,1.8,1.8);
28  Axes; 
29  Debut; 
30   Graduations; Unites(1);
31
32   drawoptions(withpen pencircle scaled 0.5 withcolor LightSlateGrey);
33   trace ((-2,-2)--(-2,2)--(2,2)--(2,-2)--cycle);
34
35   nb  = 80;
36   pas = 2*Pi/nb;
37   for i=0 upto nb: trace (0,2*sin(i*pas))--(2*cos(i*pas),0); endfor;
38
39   trace Vecteur((2,0),(1.2,0)) avecCrayon(1,RoyalBlue);
40   trace Vecteur((-2,0),(-1.2,0)) avecCrayon(1,RoyalBlue);
41   trace Vecteur((0,2),(0,1.2)) avecCrayon(1,RoyalBlue);
42   trace Vecteur((0,-2),(0,-1.2)) avecCrayon(1,RoyalBlue);
43
44   trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,DarkOrange);
45
46   pointe Point(0,0);
47   pointe Point(2,0);
48   pointe Point(0,2);
49   pointe Point(0,-2);
50   pointe Point(-2,0);
51
52  Fin;
53
54
55 endfig;
56
57 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.