Asked by bh dhouha
on 11 May 2015

As shown in the figure below i would like to find the intersection between the edge and the arc Please help me

Answer by John D'Errico
on 11 May 2015

Edited by John D'Errico
on 11 May 2015

Simplest is to turn them into a pair of polygons, then use Doug Schwarz's intersections tool from the file exchange. Just generate sufficiently many points on the circular arc, and it will be accurate.

If you want an exact or symbolic solution, then this too is doable. Not even that difficult. Simply formulate the equations of a circle and a line, then use solve.

syms x y t x1 x2 y1 y2 x0 y0 r theta

linex = (1-t)*x1 + t*x2;

liney = (1-t)*y1 + t*y2;

circlex = r*cos(theta) + x0;

circley = r*sin(theta) + y0;

[t,theta] = solve(linex == circlex,liney == circley,{t,theta});

Substitute in the values of {x0,y0,r,x1,x2,y1,y2}. If t is between 0 and 1, and theta is in the appropriate interval, then you have an intersection.

Or you could do it using fsolve, or pencil and paper.

bh dhouha
on 11 May 2015

Walter Roberson
on 11 May 2015

John D'Errico
on 11 May 2015

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 6 Comments

## Adam (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284514

## Walter Roberson (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284518

## bh dhouha (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284525

## Adam (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284536

## bh dhouha (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284538

## Adam (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/216258-how-to-return-the-intersection-point-of-a-line-and-a-circle-arc#comment_284541

Sign in to comment.