Least squares approximation for two circles and two lines
2 次查看(过去 30 天)
显示 更早的评论
Can anyone please tell me how to do a least squares approximation for two circles and two(or one) line to find their approximate intersection point? Thank you.
0 个评论
回答(1 个)
Torsten
2016-2-26
编辑:Torsten
2016-2-26
Use fmincon to solve the optimization problem
min: sqrt((x*-x1*)^2+(y*-y1*)^2)+sqrt((x*-x2*)^2+(y*-y2*)^2)+sqrt((x*-x3*)^2+(y*-y3*)^2)+sqrt((x*-x4*)^2+(y*-y4*)^2)
under the constraints
(x1*-x1)^2+(y1*-y1)^2=R1^2
(x2*-x2)^2+(y2*-y2)^2=R2^2
x3*=x3+lambda*l_x3
y3*=y3+lambda*l_y3
x4*=x4+mu*l_x4
y4*=y4+mu*l_y4
Here,
x1,y1,R1,x2,y2,R2,x3,l_x3,y3,l_y3,x4,l_x4,y4,l_y4
are known parameters and
x1*,y1*,x2*,y2*,x3*,y3*,x4*,y4*,lambda, mu, x*,y*
are the unknowns to be solved for.
(x*,y*) will be the approximate intersection point.
Best wishes
Torsten.
2 个评论
Torsten
2016-2-26
Then replace constraints (3-6) by
y3*=m1*x3*+b1
y4*=m2*x4*+b2
and remove lambda and mu from the list of unknowns.
Best wishes
Torsten.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!