XMVector2IntersectLine function (directxmath.h)

Finds the intersection of two lines.

Syntax

XMVECTOR XM_CALLCONV XMVector2IntersectLine(
  [in] FXMVECTOR Line1Point1,
  [in] FXMVECTOR Line1Point2,
  [in] FXMVECTOR Line2Point1,
  [in] GXMVECTOR Line2Point2
) noexcept;

Parameters

[in] Line1Point1

2D vector describing the first point on the first line.

[in] Line1Point2

2D vector describing a second point on the first line.

[in] Line2Point1

2D vector describing the first point on the second line.

[in] Line2Point2

2D vector describing a second point on the second line.

Return value

Returns the intersection point. If the lines are parallel, the returned vector will be a NaN. If the two lines are coincident, the returned vector will be positive infinity.

Remarks

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Requirement Value
Target Platform Windows
Header directxmath.h (include DirectXMath.h)

See also

DirectXMath Library 2D Vector Geometric Functions