Click or drag to resize

UtilIntersectLineLine Method (Vector2, Vector2, Vector2, Vector2, Boolean)

Calculate the intersection point of two lines or two line segments.

If bounded is true, this acts like IntersectLineLine(Vector2, Vector2, Vector2, Vector2), otherwise, it considers both lines to extend indefinitely.

Namespace:  Demo3D.Common
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
public static Vector2? IntersectLineLine(
	Vector2 p1,
	Vector2 p2,
	Vector2 q1,
	Vector2 q2,
	bool bounded
)

Parameters

p1
Type: Microsoft.DirectXVector2
First point on first line or start of first line segment.
p2
Type: Microsoft.DirectXVector2
Second point on first line or end of first line segment.
q1
Type: Microsoft.DirectXVector2
First point on second line or start of second line segment.
q2
Type: Microsoft.DirectXVector2
Second point on second line or end of second line segment.
bounded
Type: SystemBoolean
If true, then consider as line segments, otherwise consider as lines.

Return Value

Type: NullableVector2
null if no intersection, or a Vector2 containing the intersection point.
See Also