Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
clear maths solution in Clear category for Three Points Circle by kdim
def checkio(data):
(x1, y1), (x2, y2), (x3, y3) = eval(data)
a, b, c, d = x2 - x1, y2 - y1, x3 - x1, y3 - y1
e, f, g = a * (x1 + x2) + b * (y1 + y2), c * (x1 + x3) + d * (y1 + y3), 2 * (a * (y3 - y2) - b * (x3 - x2))
x, y = (d * e - b * f) / g, (a * f - c * e) / g
r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5
return "(x-{:.3g})^2+(y-{:.3g})^2={:.3g}^2".format(round(x, 2), round(y, 2), round(r,2))
Feb. 16, 2021