Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_Geometry🞂SegmentIntersectFunction

SegmentIntersect

Calculates the intersection point between two 2D line segments P1-P2 and P3-P4.

Declarations ​

pascal
function SegmentIntersect(const P1, P2, P3, P4: TFloatPoint; out IntersectPoint: TFloatPoint): Boolean; overload;
function SegmentIntersect(const P1, P2, P3, P4: TFixedPoint; out IntersectPoint: TFixedPoint): Boolean; overload;
Overload Details

Overload 1 ​

pascal
function SegmentIntersect(const P1, P2, P3, P4: TFloatPoint; out IntersectPoint: TFloatPoint): Boolean; overload;

Calculates intersection point between floating-point line segments P1-P2 and P3-P4.

ParameterTypeDescription
P1, P2TFloatPointEndpoints of first line segment.
P3, P4TFloatPointEndpoints of second line segment.
IntersectPointTFloatPointOutput point receiving intersection coordinates.
TypeDescription
BooleanReturns True if the line segments intersect; otherwise False.

Overload 2 ​

pascal
function SegmentIntersect(const P1, P2, P3, P4: TFixedPoint; out IntersectPoint: TFixedPoint): Boolean; overload;

Calculates intersection point between fixed-point line segments P1-P2 and P3-P4.

ParameterTypeDescription
P1, P2TFixedPointEndpoints of first line segment.
P3, P4TFixedPointEndpoints of second line segment.
IntersectPointTFixedPointOutput point receiving intersection coordinates.
TypeDescription
BooleanReturns True if the line segments intersect; otherwise False.

Description ​

SegmentIntersect determines whether line segment P1→P2 intersects line segment P3→P4.

If an intersection occurs on both segments, the function populates IntersectPoint with the coordinates of the intersection and returns True. If the segments are parallel or do not overlap, the function returns False.