Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2007-11-30
帖子: 2
声望力: 0 ![]() |
![]()
%circfit.m
function [xc,yc,R,a] = circfit(x,y) %CIRCFIT Fits a circle in x,y plane % [XC, YC, R, A] = CIRCFIT(X,Y) % Result is center point (yc,xc) and radius R.A is an % optional output describing the circle's equation: % x^2+y^2+a(1)*x+a(2)*y+a(3)=0 n=length(x); xx=x.*x; yy=y.*y; xy=x.*y; A=[sum(x) sum(y) n;sum(xy) sum(yy)... sum(y);sum(xx) sum(xy) sum(x)]; B=[-sum(xx+yy) ; -sum(xx.*y+yy.*y) ; -sum(xx.*x+xy.*y)]; a=A\B; xc = -.5*a(1); yc = -.5*a(2); R = sqrt((a(1)^2+a(2)^2)/4-a(3)); 这是一个圆的曲线拟合,网上摘下来的,但具体的思想、思路不清楚,哪位高手给 解释解释啊? 谢谢!! |
![]() |
![]() |