<PackageReference Include="System.Numerics.Vectors" Version="4.4.0-preview1-25305-02" />

System.Numerics.Quaternion

public struct Quaternion : IEquatable<Quaternion>
A structure encapsulating a four-dimensional vector (x,y,z,w), which is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where w = cos(theta/2).
public float W

Specifies the rotation component of the Quaternion.

public float X

Specifies the X-value of the vector component of the Quaternion.

public float Y

Specifies the Y-value of the vector component of the Quaternion.

public float Z

Specifies the Z-value of the vector component of the Quaternion.

public static Quaternion Identity { get; }

Returns a Quaternion representing no rotation.

public bool IsIdentity { get; }

Returns whether the Quaternion is the identity Quaternion.

public Quaternion(float x, float y, float z, float w)

Constructs a Quaternion from the given components.

public Quaternion(Vector3 vectorPart, float scalarPart)

Constructs a Quaternion from the given vector and rotation parts.

public static Quaternion Add(Quaternion value1, Quaternion value2)

Adds two Quaternions element-by-element.

public static Quaternion Concatenate(Quaternion value1, Quaternion value2)

Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation.

public static Quaternion Conjugate(Quaternion value)

Creates the conjugate of a specified Quaternion.

public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)

Creates a Quaternion from a normalized vector axis and an angle to rotate about the vector.

Creates a Quaternion from the given rotation matrix.

public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)

Creates a new Quaternion from the given yaw, pitch, and roll, in radians.

public static Quaternion Divide(Quaternion value1, Quaternion value2)

Divides a Quaternion by another Quaternion.

public static float Dot(Quaternion quaternion1, Quaternion quaternion2)

Calculates the dot product of two Quaternions.

public static Quaternion Inverse(Quaternion value)

Returns the inverse of a Quaternion.

public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount)

Linearly interpolates between two quaternions.

public static Quaternion Multiply(Quaternion value1, Quaternion value2)

Multiplies two Quaternions together.

public static Quaternion Multiply(Quaternion value1, float value2)

Multiplies a Quaternion by a scalar value.

public static Quaternion Negate(Quaternion value)

Flips the sign of each component of the quaternion.

public static Quaternion Normalize(Quaternion value)

Divides each component of the Quaternion by the length of the Quaternion.

public static Quaternion op_Addition(Quaternion value1, Quaternion value2)

Adds two Quaternions element-by-element.

public static Quaternion op_Division(Quaternion value1, Quaternion value2)

Divides a Quaternion by another Quaternion.

public static bool op_Equality(Quaternion value1, Quaternion value2)

Returns a boolean indicating whether the two given Quaternions are equal.

public static bool op_Inequality(Quaternion value1, Quaternion value2)

Returns a boolean indicating whether the two given Quaternions are not equal.

public static Quaternion op_Multiply(Quaternion value1, Quaternion value2)

Multiplies two Quaternions together.

public static Quaternion op_Multiply(Quaternion value1, float value2)

Multiplies a Quaternion by a scalar value.

public static Quaternion op_Subtraction(Quaternion value1, Quaternion value2)

Subtracts one Quaternion from another.

public static Quaternion op_UnaryNegation(Quaternion value)

Flips the sign of each component of the quaternion.

public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount)

Interpolates between two quaternions, using spherical linear interpolation.

public static Quaternion Subtract(Quaternion value1, Quaternion value2)

Subtracts one Quaternion from another.

public bool Equals(Quaternion other)

Returns a boolean indicating whether the given Quaternion is equal to this Quaternion instance.

public float Length()

Calculates the length of the Quaternion.

public float LengthSquared()

Calculates the length squared of the Quaternion. This operation is cheaper than Length().