请把下面代码的所有 .x改为[0] 所有.y改为[1]:def getCircle(p1, p2, p3): x21 = p2.x - p1.x y21 = p2.y - p1.y x32 = p3.x - p2.x y32 = p3.y - p2.y # three colinear if (x21 * y32 - x32 * y21 == 0): return None xy21 = p2.x * p2.x - p1.x * p1.x + p2.y * p2.y - p1.y * p1.y xy32 = p3.x * p3.x - p2.x * p2.x + p3.y * p3.y - p2.y * p2.y y0 = (x32 * xy21 - x21 * xy32) / 2 * (y21 * x32 - y32 * x21) x0 = (xy21 - 2 * y0 * y21) / (2.0 * x21) R = ((p1.x - x0) ** 2 + (p1.y - y0) ** 2) ** 0.5 return x0, y0, R
时间: 2023-05-26 11:02:41 浏览: 154
python opencv实现任意角度的透视变换实例代码.pdf
把下面代码的所有 .x改为[0] 所有.y改为[1]:
def getCircle(p1, p2, p3):
x21 = p2[0] - p1[0]
y21 = p2[1] - p1[1]
x32 = p3[0] - p2[0]
y32 = p3[1] - p2[1]
阅读全文