Search code examples
mathtrigonometrygeometrysegment

Calculate point and circle segment collision


If I have calculated an intersection point between a line segment and a circle, how can I tell whether or not this intersection point lies on a segment of the circle?

I have the equations to tell whether or not a line segment intersects with the circle, and I also have the intersection point on that circle, but what I need to know is whether or not this collision point on the circle lies within the bounds of a specific arg segment of that circle. I have the end points of the arc segment, the circle's center & radius, and the point of collision.


Solution

  • Transform the intersection point into polar coordinates around the center and compare the angles.