已知三个坐标点,求圆半径

将三个点设为(x1,y1),(x2,y2),(x3,y3);

则:

x0=((y3-Y1)*(Y2*Y2-Y1*Y1+X2*X2-X1*X1)+(Y2-Y1)*(Y1* Y1 – y3*y3+X1*X1-x3*x3))/(2*(X2-X1)*(y3-Y1)-2*(x3-X1)*(Y2-Y1))
y0=((x3-X1)*(X2*X2-X1*X1+Y2*Y2-Y1*Y1)+(X2-X1)*(X1*X1-x3*x3+Y1*Y1-y3*y3))/ (2*(Y2-Y1)*(x3-X1)-2*(y3-Y1)*(X2-X1))
r=sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0))

Leave a comment

您的电子邮箱地址不会被公开。