10 views (last 30 days)

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 ).

Matt J
on 12 Mar 2020

It's a non-differentiable, one dimensional cost function minimization. I would use fminbnd,

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.

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 3 Comments

## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809259

⋮## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809259

## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809441

⋮## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809441

## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809556

⋮## Direct link to this comment

https://es.mathworks.com/matlabcentral/answers/510577-minimising-the-summation-of-distance-between-two-curves-by-placing-the-arc-at-best-distance-from-or#comment_809556

Sign in to comment.