summaryrefslogtreecommitdiff
path: root/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06.mp
blob: 74a2fd81acf6255f57b2ce7dbdb9f2c5f4f8a553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
input geom2d;

labeloffset := 6;
gddU:=1.5cm;

vardef r(expr t)  = cos(t)*cos(t)*cos(t)-sin(t)*sin(t)*sin(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;

a = arccos(1/sqrt(3));

beginfig(1);

 Repere(6,6,2,4,3,3);
 Axes; 
 Debut; 
  Graduations; Unites(1);

  drawoptions(withcolor Gainsboro);

  trace (0,0)--rp(-Pi/12);
  trace (0,0)--rp(-Pi/4);
  trace (0,0)--rp(-5Pi/12);

  traceDoubleVecteur(rp(Pi/4),(0.18,0.18)) avecCrayon(1,DarkOrchid);
  traceDoubleVecteur(rp(-Pi/4),(0.18,0.18)) avecCrayon(1,DarkOrchid);
  traceDoubleVecteur(rp(-Pi/12),(0.18,0.18)) avecCrayon(1,DarkOrchid);
  traceDoubleVecteur(rp(-5Pi/12),(0.18,0.18)) avecCrayon(1,DarkOrchid);

  trace CourbeEnPolaires(r,-Pi/2,Pi/2,150)  avecCrayon(1.5,Crimson);

  drawoptions(withcolor LightGoldenrod);

  pointe Point(0,0);
  pointe rp(-Pi/12);
  pointe rp(-Pi/4);
  pointe rp(-5Pi/12);

 Fin;
endfig;
end