Malfatti (circunferencias)

Triángulo

polígono1, c, a, b = Polygon(A, B, C)
U = Point(c)
h, i = AngularBisector(c, b)
d_1, e_1 = AngularBisector(b, a)
I = Intersect(e_1, i)
j = AngularBisector(U, A, I)
d = AngularBisector(U, B, I)
D = Intersect(d, j)
t = OrthogonalLine(D, c)
G = Intersect(t, c)
l = AngularBisector(C, B, I)
m = AngularBisector(B, C, I)
E = Intersect(l, m)
q = AngularBisector(A, C, I)
r = AngularBisector(C, A, I)
F = Intersect(q, r)
b_1 = OrthogonalLine(F, b)
J = Intersect(b_1, b)
i_1 = Line(D, F)
K = Intersect(i_1, i)
j_1 = OrthogonalLine(K, i_1)
i' = Mirror(i, j_1)
m_1 = Line(E, F)
M = Intersect(m_1, e_1)
n_1 = OrthogonalLine(M, m_1)
p_1 = Mirror(e_1, n_1)
N = Intersect(i', p_1)
s = AngularBisector(N, G, A)
n = AngularBisector(N, J, A)
a_1 = OrthogonalLine(E, a)
H = Intersect(a_1, a)
p = AngularBisector(N, G, B)
f = AngularBisector(N, H, B)
k = AngularBisector(N, J, C)
e = AngularBisector(N, H, C)
P = Intersect(f, p)
c_2 = OrthogonalLine(P, c)
Q = Intersect(n, s)
d_2 = OrthogonalLine(Q, b)
O = Intersect(k, e)
e_2 = OrthogonalLine(O, a)
R = Intersect(c_2, c)
S = Intersect(e_2, a)
T = Intersect(d_2, b)
f_2 = Circle(O, S)
g_2 = Circle(P, R)
h_2 = Circle(Q, T)