XMVector2Cross 函式 (directxmath.h)

計算 2D 交叉乘積。

語法

XMVECTOR XM_CALLCONV XMVector2Cross(
  [in] FXMVECTOR V1,
  [in] FXMVECTOR V2
) noexcept;

參數

[in] V1

2D 向量。

[in] V2

2D 向量。

傳回值

傳回向量。 2D 交叉產品會復寫到每個元件。

備註

下列虛擬程式代碼示範函式的作業:

XMVECTOR Result;

Result.x = V1.x * V2.y - v1.y * V2.x;
Result.y = V1.x * V2.y - v1.y * V2.x;
Result.z = V1.x * V2.y - v1.y * V2.x;
Result.w = V1.x * V2.y - v1.y * V2.x;

return Result;

請注意,2D 中的「跨產品」定義不正確。 此函式會計算通常用於 2D 圖形的幾何交叉乘積。 XMVector2Orthogonal 是 2D 中'cross-product' 的另一個可能解譯。

平臺需求

Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 與 Windows SDK for Windows 8。 支援 Win32 傳統型應用程式、Windows 市集應用程式和 Windows Phone 8 個應用程式。

規格需求

需求
目標平台 Windows
標頭 directxmath.h (包含 DirectXMath.h)

另請參閱

DirectXMath 連結庫 2D 向量幾何函式