UtilitiesFunctionsdoesLineSegmentIntersectRectVersion: NextdoesLineSegmentIntersectRect CallabledoesLineSegmentIntersectRect(start: Point2D, end: Point2D, rect: Rect2D): booleanTests whether a line segment intersects an axis-aligned rectangle. Segments fully contained in the rectangle are treated as intersections.Parametersstart: Point2DSegment start point.end: Point2DSegment end point.rect: Rect2DRectangle to test against.Returns booleanTrue when the segment crosses, touches, or lies inside the rectangle.
Tests whether a line segment intersects an axis-aligned rectangle.
Segments fully contained in the rectangle are treated as intersections.