Le billard
Author: Daniel Mentrard

Moved la bola roja dentro del círculo
y el punto azul para el palo de billar.

a = 19.900000000000002 (slider from -5 to 30, step 0.1)
b = 12.5 (slider from -5 to 30, step 0.1)
poly1, c_1, d, e_1, f = Polygon((a, b), (-(a), b), (-(a), -(b)), (a, -(b)))
r = 2.2 (slider from -5 to 5, step 0.1)
S: (-(r) / 1.5, b)
A = Intersect(xAxis, yAxis)
R: (r / 1.5, b)
E: (a, b)
c = Circle((0.0, 0.0), sqrt(a * a + b * b))
N = Mirror(E, xAxis)
O = Mirror(N, yAxis)
Q = Mirror(O, xAxis)
Star = CircleArc(A, O, N)
Depart = Point(Star)
Cane_1 = Point(Star)
Bille = (0.37732512708906507, -1.4932062951929448)
g = Segment(Depart, Bille)
Cane = Segment(Bille, Cane_1)
e = Ray(Cane_1, Bille)
B = Midpoint(Bille, Depart)
k_3 = Vector(Depart, B)
F: (x(E) - r, y(E))
G: (x(E), y(E) - r)
k = Circle(E, F)
p = Mirror(k, xAxis)
q = Mirror(p, yAxis)
s = Mirror(q, xAxis)
H = Intersect(p, f)
I = Intersect(p, e_1)
M = Intersect(s, c_1)
L = Intersect(s, d)
J = Intersect(q, e_1)
K = Intersect(q, d)
h = Segment(R, F)
T = Mirror(R, xAxis)
U = Mirror(S, xAxis)
t = Semicircle(R, S)
c1 = Semicircle(U, T)
C_1 = Intersect(c_1, h)
C = Intersect(e, h)
i = OrthogonalLine(C, h)
n = Segment(Bille, C)
C' = Mirror(C, i)
Cane_1' = Mirror(Cane_1, i)
Cane_2 = Mirror(Cane_1, i)
Bille' = Mirror(Bille, i)
j = Ray(Cane_2, Bille')
l = Segment(G, H)
D = Intersect(f, l)
P = Intersect(j, l)
m = Segment(T, I)
V = Intersect(Star, j, 1.0)
W = Intersect(e_1, m)
Z = Intersect(e_1, m)
A1 = Intersect(e_1, m)
B1 = Intersect(e_1, m)
C1 = Intersect(j, m)
a1 = OrthogonalLine(C1, m)
Cane_2' = Mirror(Cane_2, a1)
Bille'' = Mirror(Bille', a1)
b1 = Ray(Cane_2', Bille'')
d1 = Segment(C, C1)
D1 = Intersect(b1, h)
e1 = OrthogonalLine(D1, h)
Cane_2'' = Mirror(Cane_2', e1)
Bille''' = Mirror(Bille'', e1)
g1 = Segment(D1, C1)
h1 = Segment(F, E)
E1 = Intersect(b1, h1)
i1 = Segment(E1, C1)
j1 = Segment(I, N)
F1 = Intersect(j, j1)
k1 = Segment(C, F1)
l1 = Segment(G, H)
G1 = Intersect(b1, l1)
m1 = Segment(C1, G1)
n1 = OrthogonalLine(G1, l1)
Cane_3 = Mirror(Cane_2', n1)
Bille'''_1 = Mirror(Bille'', n1)
t1 = Segment(C, P)
a2 = OrthogonalLine(P, l1)
Cane_4 = Mirror(Cane_2, a2)
Bille''_1 = Mirror(Bille', a2)
b2 = Ray(Cane_4, Bille''_1)
K1 = Intersect(Star, b2, 1.0)
L1 = Intersect(e_1, m)
M1 = Intersect(b2, m)
c2 = Segment(P, M1)
d2 = OrthogonalLine(M1, m)
Cane_4' = Mirror(Cane_4, d2)
Bille''_1' = Mirror(Bille''_1, d2)
h2 = Segment(H, N)
O1 = Intersect(j, h2)
i2 = Segment(C, O1)
j2 = Segment(S, R)
Q1 = Intersect(Star, b2, 1.0)
R1 = Intersect(Star, b2, 1.0)
S1 = Intersect(Star, b2, 1.0)
T1 = Intersect(j1, b2)
l2 = Segment(P, T1)
m2 = Segment(E, G)
U1 = Intersect(b1, m2)
n2 = Segment(U1, C1)
p2 = Segment(U, T)
V1 = Intersect(j, p2)
q2 = Segment(C, V1)
r2 = Segment(J, U)
W1 = Intersect(j, r2)
s2 = Segment(C, W1)
t2 = OrthogonalLine(W1, r2)
Cane_5 = Mirror(Cane_2, t2)
Bille''_2 = Mirror(Bille', t2)
a3 = Ray(Cane_5, Bille''_2)
b3 = Segment(M, S)
Z1 = Intersect(a3, b3)
c3 = Segment(Q, M)
d3 = Segment(Z1, W1)
A2 = Intersect(e, j2)
e3 = Segment(A2, Bille)
B2 = Intersect(e, h1)
f3 = Segment(B2, Bille)
C2 = Intersect(e, b3)
g3 = Segment(C2, Bille)
h3 = OrthogonalLine(C2, b3)
Cane_6 = Mirror(Cane_1, h3)
Bille'_1 = Mirror(Bille, h3)
i3 = Ray(Cane_6, Bille'_1)
D2 = Intersect(i3, r2)
j3 = Segment(C2, D2)
k3 = Segment(O, J)
E2 = Intersect(i3, k3)
l3 = Segment(C2, E2)
m3 = Segment(K, O)
F2 = Intersect(i3, m3)
n3 = Segment(C2, F2)
p3 = Segment(L, K)
G2 = Intersect(i3, p3)
q3 = Segment(C2, G2)
H1 = Intersect(b1, b3)
f1 = Segment(H1, C1)
p1 = Segment(Q, M)
I1 = Intersect(a3, p1)
q1 = Segment(I1, W1)
r1 = Segment(Q, L)
J1 = Intersect(a3, r1)
s1 = Segment(J1, W1)
N1 = Intersect(a3, p3)
e2 = Segment(N1, W1)
P1 = Intersect(e, p1)
f2 = Segment(P1, Bille)
H2 = Intersect(e, r1)
g2 = Segment(H2, Bille)
I2 = Intersect(e, p3)
k2 = Segment(I2, Bille)
r3 = OrthogonalLine(I2, p3)
Cane_7 = Mirror(Cane_1, r3)
Bille'_2 = Mirror(Bille, r3)
s3 = Ray(Cane_7, Bille'_2)
J2 = Intersect(c_1, b3)
K2 = Intersect(s3, b3)
t3 = Segment(I2, K2)
L2 = Intersect(s3, j2)
a4 = Segment(I2, L2)
b4 = OrthogonalLine(G2, p3)
Cane_6' = Mirror(Cane_6, b4)
Bille'_1' = Mirror(Bille'_1, b4)
c4 = Ray(Cane_6', Bille'_1')
M2 = Intersect(c4, r2)
d4 = Segment(G2, M2)
N2 = Intersect(c4, p2)
e4 = Segment(G2, N2)
O2 = Intersect(c4, m)
f4 = Segment(G2, O2)
P2 = Intersect(s3, h)
g4 = Segment(I2, P2)
h4 = CircleSector(Q, L, M)
poly3, m4, n4, p4, q4 = Polygon((a + r, b + r), (-(a) - r, b + r), (-(a + r), -(b) - r), (a + r, -(b) - r))
poly2, i4, j4, k4, l4 = Polygon((a, b), (-(a), b), (-(a), -(b)), (a, -(b)))
r4 = CircleSector(E, F, G)
s4 = Circle(Bille, 5.0)
Q2 = Intersect(s4, Cane)
t4 = Segment(Bille, Q2)
a5 = Segment(Q2, Cane_1)
c5 = CircleSector(N, H, I)
d5 = CircleSector(O, J, K)
e5 = Circle(A, 4.0)