Click or drag to resize

UtilIntersectLineLine Method (Vector2, Vector2, Vector2, Vector2)

Calculate the intersection point of two line segments.

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
)

Parameters

p1
Type: Microsoft.DirectXVector2
Start of first line segment.
p2
Type: Microsoft.DirectXVector2
End of first line segment.
q1
Type: Microsoft.DirectXVector2
Start of second line segment.
q2
Type: Microsoft.DirectXVector2
End of second line segment.

Return Value

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