Une nouvelle série d'exemples : des courbes paramétrées
[mp-gdd.git] / exemples / courbes / cp01.mp
diff --git a/exemples/courbes/cp01.mp b/exemples/courbes/cp01.mp
new file mode 100644 (file)
index 0000000..47e84c8
--- /dev/null
@@ -0,0 +1,57 @@
+input gdd;
+input gdd-rep;
+input gdd-lbl;
+input gdd-tra;
+input svgnames;
+
+lblPreambule := "\usepackage[frenchb]{babel}"       &
+                "\usepackage[garamond]{mathdesign}" &
+                "\usepackage{amsmath}";
+
+input gdd-fct;
+input gdd-plt;
+
+labeloffset := 6;
+gddU:=1.2cm;
+
+vardef f(expr t) = 2*cos(t)*cos(t)*cos(t) enddef;
+vardef g(expr t) = 2*sin(t)*sin(t)*sin(t) enddef;
+
+def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef;
+
+
+
+beginfig(1);
+
+
+ Repere(8,8,4,4,1.8,1.8);
+ Axes; 
+ Debut; 
+  Graduations; Unites(1);
+
+  drawoptions(withpen pencircle scaled 0.5 withcolor LightSlateGrey);
+  trace ((-2,-2)--(-2,2)--(2,2)--(2,-2)--cycle);
+
+  nb  = 80;
+  pas = 2*Pi/nb;
+  for i=0 upto nb: trace (0,2*sin(i*pas))--(2*cos(i*pas),0); endfor;
+
+  trace Vecteur((2,0),(1.2,0)) avecCrayon(1,RoyalBlue);
+  trace Vecteur((-2,0),(-1.2,0)) avecCrayon(1,RoyalBlue);
+  trace Vecteur((0,2),(0,1.2)) avecCrayon(1,RoyalBlue);
+  trace Vecteur((0,-2),(0,-1.2)) avecCrayon(1,RoyalBlue);
+
+  trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,DarkOrange);
+
+  pointe Point(0,0);
+  pointe Point(2,0);
+  pointe Point(0,2);
+  pointe Point(0,-2);
+  pointe Point(-2,0);
+
+ Fin;
+
+
+endfig;
+
+end
\ No newline at end of file

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.