Minimising the summation of distance between two curves by placing the arc at best distance from origin
3 views (last 30 days)
Show older comments
In this problem I have two curves ( one is a semi circle and the other is an arc)
- Semi circle --> Fixed curve & Arc-->Movable curve
- Arc (this arc is part of a smaller circle with center (a,b)) -->We can move this arc and have its centre placed in the best optimised way so that it would give least distance between two curves.
- Condition: The arc can only be moved in x direction and not in y direction so that we can get a new X cordinate value of arc such that summation of (distance)^2 between curves at diffrent points will be minimum.
- The distance from the arc will be taken from any tangent drawn on the arc to the semi circle. (The distance needs to be calculated between diffrent points ).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/277234/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/277235/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/276860/image.png)
3 Comments
Answers (1)
Matt J
on 12 Mar 2020
It's a non-differentiable, one dimensional cost function minimization. I would use fminbnd,
2 Comments
Matt J
on 14 Mar 2020
Edited: Matt J
on 14 Mar 2020
the line will pass through the arc centre but distance that i need to calculate is between two curves....and that also at multiple points???
With each point on the small circle, you can associate a polar coordinate angle theta relative to its center (a,b). The line passing through the point and (a,b) has the parametric form
p(a,theta,t)=[a+t*cos(theta);b+t*sin(theta)];
The point p(a,theta,t) will lie on the larger circle (with radius Rbig) if it satisfies
(a+t*cos(theta)).^2 + ( b+t*sin(theta) ).^2=Rbig.^2
For each fixed theta, this is a quadratic equation in t, which you can solve either analytically, or with the roots() command. Once you find the t0 at which p(a,theta,t0) lies on the larger circle, the distance d(theta,a) between the two arcs is
d(theta,a)=abs(Rsmall - norm(p(t0,theta,a)-[a;b]) );
Summing this over all theta, you get an objective function that varies with a and can use fminbnd to minimize it.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!