Problema di Erone.
Dati 2 punti e n rette, determinare il minimo cammino 
che porta da P a Q toccando le n rette. 

D = (-3.2391320437798203, 0.9256074297662062)
C = (-3.2756084629810793, 0.44355108670573684)
B = (-4.55831678042067, -0.165080921058971)
a = Line(B, C)
F = Point(a)
distanzaDF = Distance(D, F)
D' = Mirror(D, a)
A = (-4.394884800323605, 0.7556437890980026)
distanzaAF = Distance(A, F)
d1: distanzaAF + distanzaDF
b = Segment(A, D')
E = Intersect(a, b)
distanzaED = Distance(E, D)
distanzaAE = Distance(A, E)
dmin1: distanzaAE + distanzaED
c = Segment(D, E)
d = Segment(A, E)
e = Segment(E, D')
f = Segment(A, F)
g = Segment(F, D)
TestoAE: "\overline{" + (Name[A]) + (Name[E]) + "} \, = \, " + distanzaAE
TestoED: "\overline{" + (Name[E]) + (Name[D]) + "} \, = \, " + distanzaED
TestoAF: "\overline{" + (Name[A]) + (Name[F]) + "} \, = \, " + distanzaAF
TestoDF: "\overline{" + (Name[D]) + (Name[F]) + "} \, = \, " + distanzaDF
text2: "I caso: 1 retta
distanza minima = AE + ED = " + dmin1 + "
AF + FD = " + d1
G = (-0.4178058415970064, 0.5739672145903618)
H = (-0.08630650938464247, 0.17776741082611017)
s = Line(G, H)
I = (-0.6011552363095722, -0.08248701964334781)
r = Line(H, I)
J = (-1.4035247245632207, 0.7216510609643618)
K = (-0.9871138049261218, 0.3137383233606731)
K' = Mirror(K, r)
K'' = Mirror(K', s)
j = Segment(K'', J)
L = Intersect(s, j)
k = Segment(L, K')
M = Intersect(r, k)
l = Segment(J, L)
m = Segment(L, M)
n = Segment(M, K)
p = Segment(K'', L)
q = Segment(K'', K')
r_1 = Segment(K', M)
K'_1 = Mirror(K, s)
N = Mirror(K'_1, r)
s_1 = Segment(J, N)
e_1 = Segment(N, K'_1)
t = Segment(J, N)
O = Intersect(r, t)
a_1 = Segment(O, K'_1)
P = Intersect(s, a_1)
b_1 = Segment(J, O)
c_1 = Segment(O, P)
d_1 = Segment(P, K)
f_1 = Segment(O, N)
g_1 = Segment(K'_1, P)
Q = Point(r)
R = Point(s)
h_1 = Segment(J, R)
i_1 = Segment(R, Q)
j_1 = Segment(Q, K)
distanzaJL = Distance(J, L)
TestoJL: "\overline{" + (Name[J]) + (Name[L]) + "} \, = \, " + distanzaJL
distanzaLM = Distance(L, M)
TestoLM: "\overline{" + (Name[L]) + (Name[M]) + "} \, = \, " + distanzaLM
distanzaMK = Distance(M, K)
TestoMK: "\overline{" + (Name[M]) + (Name[K]) + "} \, = \, " + distanzaMK
dmin2: distanzaJL + distanzaLM + distanzaMK
distanzaJO = Distance(J, O)
TestoJO: "\overline{" + (Name[J]) + (Name[O]) + "} \, = \, " + distanzaJO
distanzaOP = Distance(O, P)
TestoOP: "\overline{" + (Name[O]) + (Name[P]) + "} \, = \, " + distanzaOP
distanzaPK = Distance(P, K)
TestoPK: "\overline{" + (Name[P]) + (Name[K]) + "} \, = \, " + distanzaPK
dmin2b: distanzaJO + distanzaPK + distanzaOP
distanzaJR = Distance(J, R)
TestoJR: "\overline{" + (Name[J]) + (Name[R]) + "} \, = \, " + distanzaJR
distanzaRQ = Distance(R, Q)
TestoRQ: "\overline{" + (Name[R]) + (Name[Q]) + "} \, = \, " + distanzaRQ
distanzaQK = Distance(Q, K)
TestoQK: "\overline{" + (Name[Q]) + (Name[K]) + "} \, = \, " + distanzaQK
d21: distanzaJR + distanzaQK + distanzaRQ
k_1 = Segment(J, Q)
l_1 = Segment(R, K)
distanzaJQ = Distance(J, Q)
TestoJQ: "\overline{" + (Name[J]) + (Name[Q]) + "} \, = \, " + distanzaJQ
distanzaRK = Distance(R, K)
TestoRK: "\overline{" + (Name[R]) + (Name[K]) + "} \, = \, " + distanzaRK
d22: distanzaJQ + distanzaRK + distanzaRQ
text3: "II caso. 2 rette.
Dipende da quale delle due rette tocchiamo per prima.
distanza minima rs (percorso blu)  = " + dmin2b + "
distanza JQRK = " + d22 + "
distanza minima sr (percorso rosso)  = " + dmin2 + "
distanza JRQK = " + d21

Tool: Circocerchio
Clicca sul triangolo
Input: poly1
Output: p, T

A = (-1.9867180309718853, 3.399206189848298)
B = (-3.080683477006394, 1.9442321466224008)
C = (-0.6192612234287485, 1.9004735287810202)
poly1, c, a, b = Polygon(A, B, C)
j = LineBisector(a)
l = LineBisector(c)
T = Intersect(j, l)
p = Circle(T, B)

Tool: Circonferenza inscrita (command Circonferenzainscrita)
Clicca sui vertici del triangolo
Input: N, P, Q
Output: c_1, R

poly2, q_1, n_1, p_1 = Polygon(N, P, Q)
r = AngularBisector(N, Q, P)
s = AngularBisector(P, N, Q)
R = Intersect(r, s)
t = OrthogonalLine(R, p_1)
S = Intersect(t, p_1)
c_1 = Circle(R, S)

Tool: Ortocentro
Clicca sui vertici del triangolo
Input: E_1, F_1, G_1
Output: H_1

j_1 = Line(F_1, G_1)
l_1 = Line(G_1, E_1)
m_1 = OrthogonalLine(F_1, l_1)
n_1 = OrthogonalLine(E_1, j_1)
H_1 = Intersect(m_1, n_1)

Tool: Excerchi
Clicca su 3 rette che determinano un triangolo
Input: b, c, a
Output: p, E, D, F, q, r

d, e = AngularBisector(a, c)
f, g = AngularBisector(b, c)
h, i = AngularBisector(a, b)
D = Intersect(h, d)
E = Intersect(d, f)
F = Intersect(f, h)
j = OrthogonalLine(D, a)
k = OrthogonalLine(E, c)
l = OrthogonalLine(F, b)
G = Intersect(b, l)
H = Intersect(k, c)
I = Intersect(j, a)
p = Circle(E, H)
q = Circle(F, G)
r = Circle(D, I)