Skip to main content
Version: Next

doesLineSegmentIntersectRect

Callable


  • Tests whether a line segment intersects an axis-aligned rectangle.

    Segments fully contained in the rectangle are treated as intersections.


    Parameters

    • start: Point2D

      Segment start point.

    • end: Point2D

      Segment end point.

    • rect: Rect2D

      Rectangle to test against.

    Returns boolean

    True when the segment crosses, touches, or lies inside the rectangle.