| LineSegment2IIntersect Method (Vector2I, Vector2I, Vector2I, Vector2I, Boolean, Boolean, Vector2F) |
This method detects if two line segments (or lines) intersect,
and, if so, the point of intersection. Use the firstIsSegment and
secondIsSegment parameters to set whether the intersection point
must be on the first and second line segments. Setting these
both to true means you are doing a line-segment to line-segment
intersection. Setting one of them to true means you are doing a
line to line-segment intersection test, and so on.
Note: If two line segments are coincident, then
no intersection is detected (there are actually
infinite intersection points).
Author: Jeremy Bell
Namespace: Slash.Math.Geometry.LinesAssembly: Slash.Math (in Slash.Math.dll) Version: 1.0.6018.40177
Syntax public static bool Intersect(
ref Vector2I point1,
ref Vector2I point2,
ref Vector2I point3,
ref Vector2I point4,
bool firstIsSegment,
bool secondIsSegment,
out Vector2F point
)
Public Shared Function Intersect (
ByRef point1 As Vector2I,
ByRef point2 As Vector2I,
ByRef point3 As Vector2I,
ByRef point4 As Vector2I,
firstIsSegment As Boolean,
secondIsSegment As Boolean,
<OutAttribute> ByRef point As Vector2F
) As Boolean
public:
static bool Intersect(
Vector2I% point1,
Vector2I% point2,
Vector2I% point3,
Vector2I% point4,
bool firstIsSegment,
bool secondIsSegment,
[OutAttribute] Vector2F% point
)
static member Intersect :
point1 : Vector2I byref *
point2 : Vector2I byref *
point3 : Vector2I byref *
point4 : Vector2I byref *
firstIsSegment : bool *
secondIsSegment : bool *
point : Vector2F byref -> bool
Parameters
- point1
- Type: Slash.Math.Algebra.VectorsVector2I
The first point of the first line segment. - point2
- Type: Slash.Math.Algebra.VectorsVector2I
The second point of the first line segment. - point3
- Type: Slash.Math.Algebra.VectorsVector2I
The first point of the second line segment. - point4
- Type: Slash.Math.Algebra.VectorsVector2I
The second point of the second line segment. - firstIsSegment
- Type: SystemBoolean
Set this to true to require that the intersection point be on the first line segment. - secondIsSegment
- Type: SystemBoolean
Set this to true to require that the intersection point be on the second line segment. - point
- Type: Slash.Math.Algebra.VectorsVector2F
This is set to the intersection point if an intersection is detected.
Return Value
Type:
Boolean True if an intersection is detected, false otherwise.
See Also