Une nouvelle série d'exemples : des courbes paramétrées
[mp-gdd.git] / exemples / courbes / cp04.mp
diff --git a/exemples/courbes/cp04.mp b/exemples/courbes/cp04.mp
new file mode 100644 (file)
index 0000000..ee712c2
--- /dev/null
@@ -0,0 +1,56 @@
+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) = t*t+2/t enddef;
+vardef g(expr t) = t+1/t enddef;
+vardef fp(expr t) = t*t enddef;
+vardef gp(expr t) = t enddef;
+
+def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef;
+
+
+
+beginfig(1);
+
+
+ Repere(12,10,5,4,0.7,0.7);
+ Axes; 
+ Debut; 
+  Graduations; Unites(1);
+
+  drawoptions(withcolor LightSlateGrey);
+  trace Droite(Point(-4,-2),Point(4,2));
+  trace (3,0)--(3,2)--(0,2) dashed evenly;
+  trace (-1,0)--(-1,-2)--(0,-2) dashed evenly;
+  trace Courbe(fp,gp,-4,4,500);
+
+  trace Vecteur((3,2),(5,8/3)) avecCrayon(1,DeepPink);
+  trace Vecteur((-1,-2),(-2.8,-2)) avecCrayon(1,DeepPink);
+  trace Vecteur((-1,-2),(0.8,-2)) avecCrayon(1,DeepPink);
+
+  trace Courbe(f,g,-5,-0.1,100) avecCrayon(1.5,DarkCyan);
+  trace Courbe(f,g,0.1,5,100) avecCrayon(1.5,DarkCyan);
+
+  pointe Point(0,0);
+  pointe Point(3,2);
+  pointe Point(-1,-2);
+
+ 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.