Nouvelles séries d'exemples : courbes en polaires
[mp-gdd.git] / exemples / polaires / pol04.mp
diff --git a/exemples/polaires/pol04.mp b/exemples/polaires/pol04.mp
new file mode 100644 (file)
index 0000000..b5bddb6
--- /dev/null
@@ -0,0 +1,66 @@
+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 r(expr t) = cos(2t)+cos(t)*cos(t)  enddef;
+
+vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef;
+
+def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef;
+
+def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef;
+
+
+a = arccos(1/sqrt(3));
+
+
+
+beginfig(1);
+
+
+ Repere(10,8,5,4,2,2);
+ Axes; 
+ Debut; 
+  Graduations; Unites(1);
+
+  drawoptions(withcolor LightBlue);
+
+  nb = 60;
+  pas = 2Pi/ nb;
+  for i:=0 upto nb:
+    trace (0,0) -- rp(i*pas);
+  endfor;
+
+  traceDoubleVecteur((0,0),0.5(cos(a),sin(a))) avecCrayon(1,MediumVioletRed);
+  traceDoubleVecteur((0,0),0.5(-cos(a),sin(a))) avecCrayon(1,MediumVioletRed);
+  traceDoubleVecteur((2,0),(0,0.5)) avecCrayon(1,MediumVioletRed);
+  traceDoubleVecteur((-2,0),(0,0.5)) avecCrayon(1,MediumVioletRed);
+  traceDoubleVecteur((0,1),(0.5,0)) avecCrayon(1,MediumVioletRed);
+  traceDoubleVecteur((0,-1),(-0.5,0)) avecCrayon(1,MediumVioletRed);
+
+  trace CourbeEnPolaires(r,-Pi,Pi,150) avecCrayon(1.5,DarkOliveGreen);
+
+  pointe Point(0,0);
+  pointe Point(0,1);
+  pointe Point(0,-1);
+  pointe Point(2,0);
+  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.