Least squares approximation for two circles and two lines
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Torsten
on 26 Feb 2016
Edited: Torsten
on 26 Feb 2016
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 Comments
Torsten
on 26 Feb 2016
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.
See Also
Categories
Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!