我在圆的圆周上有三个点:
pt A = (A.x, A.y);
pt B = (B.x, B.y);
pt C = (C.x, C.y);如何计算圆的圆心?
在处理中实现它(Java)。
我找到了答案并实现了一个可行的解决方案:
pt circleCenter(pt A, pt B, pt C) {
float yDelta_a = B.y - A.y;
float xDelta_a = B.x - A.x;
float yDelta_b = C.y - B.y;
float xDelta_b = C.x - B.x;
pt center = P(0,0);
float aSlope = yDelta_a/xDelta_a;
float bSlope = yDelta_b/xDelta_b;
center.x = (aSlope*bSlope*(A.y - C.y) + bSlope*(A.x + B.x)
- aSlope*(B.x+C.x) )/(2* (bSlope-aSlope) );
center.y = -1*(center.x - (A.x+B.x)/2)/aSlope + (A.y+B.y)/2;
return center;
}发布于 2010-11-05 11:38:59
这可能是一个相当深入的计算。这里有一个简单的步骤:http://paulbourke.net/geometry/circlesphere/。一旦你有了圆的方程,你可以简单地把它放在一个包含H和K的形式中。点(h,k)将是圆心。
(在链接中向下滚动到方程式)
https://stackoverflow.com/questions/4103405
复制相似问题