Ajuster les tangentes

A = (-2, -1.9665684908678025)
B = (7.875897862224981, -2.0264451212034)
D = (2, 2)
I = Midpoint(A, B)
L = Midpoint(A, D)
u = Vector(A, I)
O = Translate(L, u)
J = Translate(O, u)
K = Translate(D, u)
C = Translate(K, u)
L_1 = Midpoint(A, L)
AK = Segment(A, K)
IL' = Segment(I, L_1)
E = Intersect(AK, IL')
ε = Conic(I, J, K, L, E)
AB = Line(A, B)
o = OrthogonalLine(O, AB)
F = Point(o)
v = Ray(O, F)
a_1 = Line(K, L)
P_0 = Intersect(a_1, AB)
b_1 = Line(O, P_0)
AD = Line(A, D)
c_1 = Segment(A, B)
c_2 = Segment(B, C)
c_3 = Segment(C, D)
c_4 = Segment(D, A)
M = Point(ε)
MO = Segment(M, O)
α = Point(MO)
distanceOα = Distance(O, α)
distanceOM = Distance(O, M)
ε_α = Dilate(ε, distanceOα / distanceOM, O)
OJ_s = Segment(O, J)
α_1 = Intersect(ε_α, OJ_s)
c_α = Circle(O, α_1)
S_α = Intersect(c_α, v)
u_α = Vector(O, α)
T_α = Translate(S_α, u_α)
h_α = Segment(S_α, T_α)
v_α = Segment(T_α, α)
O' = Point(v)
w = Vector(O, O')
A' = Translate(A, w)
I' = Translate(I, w)
B' = Translate(B, w)
J' = Translate(J, w)
C' = Translate(C, w)
K' = Translate(K, w)
D' = Translate(D, w)
L' = Translate(L, w)
ε' = Translate(ε, w)
M' = Translate(M, w)
O'M' = Segment(O', M')
G = Midpoint(O', O)
α' = Translate(α, w)
S'_α = Mirror(S_α, G)
T'_α = Translate(S'_α, u_α)
v'_α = Segment(α', T'_α)
h'_α = Segment(S'_α, T'_α)
P_1 = Point(AB)
KP_1 = Segment(P_1, K)
H, E_1 = Intersect(ε, KP_1)
a = OrthogonalLine(E_1, u)
P'_1 = Intersect(a, AB)
b = Tangent(E_1, ε)
P''_1 = Intersect(b, AB)
text1: "" + (Name[P'_1]) + (Name[P''_1]) + " = " + (Distance[P'_1, P''_1])
E_2 = Mirror(E_1, O)
c = OrthogonalLine(E_2, AB)
P'_2 = Intersect(AB, c)
d = Tangent(E_2, ε)
P''_2 = Intersect(AB, d)
text2: "" + (Name[P'_2]) + (Name[P''_2]) + " = " + (Distance[P'_2, P''_2])
E'_1 = Translate(E_1, w)
E'_2 = Translate(E_2, w)
KE_2 = Line(K, E_2)
P_2 = Intersect(KE_2, AB)
e = Segment(E_1, E'_1)
f = Segment(E_2, E'_2)
tan = false
text3: "(Faire glisser " + (Name[P_1]) + " pour amener " + (Name[P'_1]) + " sur " + (Name[P''_1]) + ".)"
s_c = Segment(P_1, P_2)
P_c = Point(s_c)
b_c = Line(P_c, AD)
I_c = Intersect(b_c, b_1)
a_c = Line(I_c, a_1)
P'_c = Intersect(a_c, AD)
e_c = Line(P_c, K)
e'_c = Line(I, P'_c)
E_c = Intersect(e_c, e'_c)
ε_c = Locus(E_c, P_c)
P'_4 = Mirror(P_2, P_1)
s_g = Ray(P_1, P'_4)
P'_5 = Mirror(P_1, P_2)
s_d = Ray(P_2, P'_5)
P_g = Point(s_g)
b_g = Line(P_g, AD)
I_g = Intersect(b_g, b_1)
a_g = Line(I_g, a_1)
P'_g = Intersect(a_g, AD)
e_g = Line(P_g, K)
e'_g = Line(P'_g, I)
E_g = Intersect(e'_g, e_g)
ε_g = Locus(E_g, P_g)
P_d = Point(s_d)
b_d = Line(P_d, AD)
I_d = Intersect(b_d, b_1)
a_d = Line(I_d, a_1)
P'_d = Intersect(a_d, AD)
e_d = Line(P_d, K)
e'_d = Line(P'_d, I)
E_d = Intersect(e'_d, e_d)
ε_d = Locus(E_d, P_d)