Funzione XMVector4Cross (directxmath.h)

Calcola il prodotto incrociato 4D.

Sintassi

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

Parametri

[in] V1

Vettore 4D.

[in] V2

Vettore 4D.

[in] V3

Vettore 4D.

Valore restituito

Restituisce il prodotto incrociato 4D di V1, V2 e V3.

Commenti

Un prodotto incrociato 4D non è ben definito. Questa funzione calcola un analogo geometrico al prodotto incrociato 3D. XMVector4Orthogonal è un altro 'prodotto incrociato' generalizzato per i vettori 4D.

Lo pseudocode seguente illustra l'operazione della funzione:


XMVECTOR Result;

Result.x = V1.y * (V2.z * V3.w - V3.z * V2.w)
           -  V1.z * (V2.y * V3.w - V3.y * V2.w )
           +  V1.w * (V2.y * V3.z - V3.y * V2.z);

Result.y = V1.x * (V3.z * V2.w - V2.z * V3.w)
           - V1.z * (V3.x * V2.w - V2.x * V3.w)
           + V1.w * (V3.x * V2.z - V2.x * V3.z);
                                    
Result.z = V1.x * (V2.y * V3.w - V3.y * V2.w)
           - V1.y * (V2.x * V3.w - V3.x * V2.w)
           + V1.w * (V2.x * V3.y - V3.x * V2.y);

Result.w = V1.x * (V3.y * V2.z - V2.y * V3.z)
           - V1.y * (V3.x * V2.z - V2.x * V3.z)
           + V1.z * (V3.x * V2.y - V2.x * V3.y);

return Result;
        

Requisiti della piattaforma

Microsoft Visual Studio 2010 o Microsoft Visual Studio 2012 con Windows SDK per Windows 8. Supportato per app desktop Win32, app di Windows Store e Windows Phone 8 app.

Requisiti

   
Piattaforma di destinazione Windows
Intestazione directxmath.h (include DirectXMath.h)

Vedi anche

Funzioni geometriche vettoriali DirectXMath library 4D