Edit

Share via


Vector2.Cross(Vector2, Vector2) Method

Definition

Returns the z-value of the cross product of two vectors.

Since the Vector2 is in the x-y plane, a 3D cross product only produces the z-value.

public:
 static float Cross(System::Numerics::Vector2 value1, System::Numerics::Vector2 value2);
public static float Cross(System.Numerics.Vector2 value1, System.Numerics.Vector2 value2);
static member Cross : System.Numerics.Vector2 * System.Numerics.Vector2 -> single
Public Shared Function Cross (value1 As Vector2, value2 As Vector2) As Single

Parameters

value1
Vector2

The first vector.

value2
Vector2

The second vector.

Returns

The value of the z-coordinate from the cross product.

Remarks

Return z-value = value1.X * value2.Y - value1.Y * value2.X Cross(Vector2, Vector2) is the same as taking the Dot(Vector2, Vector2) with the second vector that has been rotated 90-degrees.

Applies to