init_elements() -- among the solutions, the center lying between the vertex and the contact point local function inner_center(centers, v, t) local d = point.abs(t - v) for i = 1, centers:count() do local c = centers:get(i) if point.abs(c - v) < d then return c end end end local pos = ... z.A = point(0,0) z.B = point(10,0) L.AB = line(z.A, z.B) z.M = L.AB.mid C.MB = circle(z.M, z.B) z.X1 = point(8, 0) L.X1X2 = L.AB:orthogonal_from(z.X1) --z.P = intersection(L.X1X2, C.MB) z.P = C.MB:point(pos) T.AMP = triangle(z.A, z.M, z.P) L.MX3 = T.AMP:bisector(z.M) z.C = intersection(L.MX3, C.MB) T.PMB = triangle(z.P, z.M, z.B) L.MX4 = T.PMB:bisector(z.M) z.E = intersection(L.MX4, C.MB) -- circle tangent to (MA) and (MP) through C, inside the sector local centers = line(z.M, z.A):c_ll_p(line(z.M, z.P), z.C) z.O1 = inner_center(centers, z.M, z.C) local centers = line(z.M, z.B):c_ll_p(line(z.M, z.P), z.E) z.O2 = inner_center(centers, z.M, z.E)