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.
| Parameter | Type | Description |
|---|---|---|
P1, P2 | TFloatPoint | Endpoints of first line segment. |
P3, P4 | TFloatPoint | Endpoints of second line segment. |
IntersectPoint | TFloatPoint | Output point receiving intersection coordinates. |
| Type | Description |
|---|---|
Boolean | Returns 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.
| Parameter | Type | Description |
|---|---|---|
P1, P2 | TFixedPoint | Endpoints of first line segment. |
P3, P4 | TFixedPoint | Endpoints of second line segment. |
IntersectPoint | TFixedPoint | Output point receiving intersection coordinates. |
| Type | Description |
|---|---|
Boolean | Returns True if the line segments intersect; otherwise False. |
Description ​
SegmentIntersect determines whether line segment
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.