Initialisation du projet svganimation
[svganimation.git] / ellipsographe / ellipsographe.mp
1 %@DATE: 30 mai 2005
2
3 prologues := 3;
4 outputtemplate := "svg/%j-%c.svg";
5 outputformat := "svg";
6
7 u = 1cm;
8
9 % Les points fixes
10 pair A, B;
11 A = (0,0);
12 B = (3u,0);
13
14 % Les deux cercles
15 path cA, cB;
16 cA = fullcircle scaled 8u shifted A;
17 cB = fullcircle scaled 8u shifted B;
18
19 % Les articulations.
20 pair C,D,E;
21
22 vardef Point(expr p) =
23     draw p withpen pencircle scaled 4;
24     draw p withpen pencircle scaled 3 withcolor white;
25 enddef;
26
27 % L'ellipse;
28 path e;
29
30
31 for i=0 upto 90:
32   beginfig(i+1);
33
34     fill (-120,-120)--(-120,120)--(210,120)--(210,-120)--cycle withcolor (0.6,0.7,0.8);
35
36     C := point (8*i/90.5+0.01) of cB;
37     D := (C + A -B) reflectedabout(A,C);
38     E := (B--C) intersectionpoint (A--D);
39
40     fill cB withcolor 0.8white;
41
42     drawoptions(withcolor 0.6white);
43     draw cA;
44     draw cB;
45     drawoptions();
46
47     drawarrow subpath (0,8*i/90.5) of cB;
48
49     if i=0:
50         e := E;
51     else:
52         e := e -- E;
53         draw e withpen pencircle scaled 1 withcolor blue;
54     fi
55
56     drawoptions(withpen pensquare scaled 2 withcolor (1,0.08,0.58));
57     draw A--D;
58     draw B--C;
59     draw C--D;
60     drawoptions();
61
62     Point(A);
63     Point(B);
64     Point(C);
65     Point(D);
66     Point(E);
67
68   endfig;
69 endfor;
70
71 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.