Line segment and arc intersection

3.9k Views Asked by At

Firstly, I have a line segment, defined in terms of two points i.e. start point and end point. Secondly, I have an arc, defined in terms of two points i.e. start point and end point along with its starting angle and ending angle. Is there any way to find the intersection points between line segment and arc. Probably given in terms of a program.

1

There are 1 best solutions below

4
On

Hints:

The difference between the end and start angles give you the arc amplitude. Knowing the chord length (distance between the endpoints), you can compute the radius and the distance of the chord to the center by simple trigonometry.

By writing the parametric equations of the bissectrix you can locate the center.

Now translate all items to bring the center at the origin, and rotate them so that the line segment becomes horizontal, say at ordinate $h$ (the rotation angle is the opposite of the segment slope).

Solve for the intersections from the system

$$x^2+y^2=r^2,y=h.$$

This gives zero or two solutions $x=\pm\sqrt{r^2-h^2}$. By computing the arguments $\arctan y/x$ you will be able to tell if they belong to the (rotated) arc.

And by a discussion on $x$, you will be able to tell if they belong to the (rotated) segment.

After you have selected the feasible solutions, counter-rotate and counter-translate the intersections.

This is the global strategy, details need to be discussed.

enter image description here