Debian Codegraph @

texmf-dist/doc/metapost/mp-geom2d/exemples/triangles/apollonius.mp

raw
1 input geom2d;
2 gddU:=0.35cm;
3 beginfig(1);
4 % nos trois points
5 A = Point(0,0);
6 B = Point(6,0);
7 C = Point(0.8,4);
8 T_ABC = Triangle(A,B,C);
9
10 C_I = CercleInscrit(T_ABC);
11 C_A = CercleExinscrit(T_ABC,2);
12 C_B = CercleExinscrit(T_ABC,3);
13 C_C = CercleExinscrit(T_ABC,1);
14
15 d_AB = Droite(A,B);
16 d_BC = Droite(B,C);
17 d_CA = Droite(C,A);
18
19 I = Centre(C_I);
20 I_C_A = Centre(C_A);
21 I_C_B = Centre(C_B);
22 I_C_C = Centre(C_C);
23 d_CAA = Droite(A,I_C_A);
24 d_CAB = Droite(B,I_C_B);
25 d_CAC = Droite(C,I_C_C);
26
27 A_S = AxeDeSimilitude(C_A,C_B,C_C);
28 P_CA = ProjectionPointSurDroite(I_C_A,A_S);
29 P_CB = ProjectionPointSurDroite(I_C_B,A_S);
30 P_CC = ProjectionPointSurDroite(I_C_C,A_S);
31
32 P_A = Inversion(P_CA,C_A);
33 P_B = Inversion(P_CB,C_B);
34 P_C = Inversion(P_CC,C_C);
35
36 C_R = CentreRadical(C_A,C_B,C_C);
37 % les neuf points pour les cercles d’euler (tangent intérieur)
38 % et d’apollonius (tangent extérieur)
39 D1 = Droite(C_R,P_A);
40 P1 = IntersectionDroiteCercle(D1,C_A,1);
41 Q1 = IntersectionDroiteCercle(D1,C_A,2);
42
43 D2 = Droite(C_R,P_B);
44 P2 = IntersectionDroiteCercle(D2,C_B,1);
45 Q2 = IntersectionDroiteCercle(D2,C_B,2);
46
47 D3 = Droite(C_R,P_C);
48 P3 = IntersectionDroiteCercle(D3,C_C,2);
49 Q3 = IntersectionDroiteCercle(D3,C_C,1);
50
51 % le cercle d’apollonius
52 Apol = CercleTroisPoints(P1,P2,P3);
53 colorie Apol withcolor 1.05*Lavender;
54 trace Apol withcolor CadetBlue;
55
56 % cercle inscrit
57 colorie C_I withcolor LightBlue;
58 % cercles exinscrits
59 colorie C_A withcolor PapayaWhip;
60 colorie C_B withcolor PapayaWhip;
61 colorie C_C withcolor PapayaWhip;
62
63 trace d_AB;
64 trace d_BC;
65 trace d_CA;
66
67 trace d_CAA dashed evenly;
68 trace d_CAB dashed evenly;
69 trace d_CAC dashed evenly;
70
71 trace T_ABC withpen pencircle scaled 2 withcolor Chocolate;
72
73 C_E = CercleEuler(T_ABC);
74 trace C_E withcolor Goldenrod;
75
76 pointe P1;
77 pointe P2;
78 pointe P3;
79
80 pointe Q1;
81 pointe Q2;
82 pointe Q3;
83
84
85 marque.llft "A";
86 marque.urt "B";
87 marque.urt "C";
88 Fenetre(-7,-12,20,15)
89 endfig;
90 end.