已知三点求圆的方程的c语言编程

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 09:21:36
已知三点求圆的方程的c语言编程
xRJ@/֐d{4W$)4iݶRDzA zA^ڂM3|tzؼyofސe^/r\V(ޖ7dUěfv]~O(sһ0?uU9D, [ REBg4nXv#TAa 'fj ob ³UB28)D)0%ZYG ȴj"SGD9ȮC8"qIX\bەJ: ũ_ۈ?6INܓ>*TEjևT+qd5À蟳WpU܅#DzKCJ[>ӧ|ZqߋP>_

已知三点求圆的方程的c语言编程
已知三点求圆的方程的c语言编程

已知三点求圆的方程的c语言编程
//
# include
void get_circle(double x1, double y1, double x2, double y2, double x3, double y3, double* r, double* x0, double* y0)
{
double m1, n1, m2, n2, a1, b1, a2, b2;
m1 = (x1 + x3) / 2;
n1 = (y1 + y3) / 2;
m2 = (x2 + x3) / 2;
n2 = (y2 + y3) / 2;
a1 = (y3 - y1) / (x3 - x1);
b1 = n1 - a1*m1;
a2 = (y3 - y2) / (x3 - x2);
b2 = n2 - a2*m2;
*x0 = (b2 - b1) / (a1 - a2);
*y0 = a1 * *x0 + b1;
*r = sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));
return;
}

希望对你有帮助!