Struct Quaternion

Quaternion structure

Quaternion is usually used to perform rotation in computer graphics.

public struct Quaternion

Constructors

NameDescription
Quaternion(double, double, double, double)Initializes a new instance of the Quaternion class.

Properties

NameDescription
Length { get; }Gets the length of the quaternion

Methods

NameDescription
static FromAngleAxis(double, Vector3)Creates a quaternion around given axis and rotate in clockwise
static FromEulerAngle(Vector3)Creates quaternion from given Euler angle
static FromEulerAngle(double, double, double)Creates quaternion from given Euler angle
static FromRotation(Vector3, Vector3)Creates a quaternion that rotate from original to destination direction
static Interpolate(float, Quaternion, Quaternion)Populates this quaternion with the interpolated value between the given quaternion arguments for a t between from and to.
static Slerp(double, Quaternion, Quaternion)Perform spherical linear interpolation between two values
Concat(Quaternion)Concatenate two quaternions
Conjugate()Returns a conjugate quaternion of current quaternion
Dot(Quaternion)Dots product
override Equals(object)Check if two quaternions equals
EulerAngles()Converts quaternion to rotation represented by Euler angles All components are in radian
override GetHashCode()Gets the hash code of Quaternion
Inverse()Returns a inverse quaternion of current quaternion
Normalize()Normalize the quaternion
ToAngleAxis(out double, out Vector3)
ToMatrix()Convert the rotation presented by quaternion to transform matrix.
override ToString()Gets the representation of quaternion in string
operator +Operator overloading for +
operator /Operator overloading for /
operator ==Equal operator for quaternion
operator !=Not-equal operator for quaternion
operator *Operator overloading for * (5 operators)

Fields

NameDescription
static readonly IdentityThe Identity quaternion.
WThe w component.
XThe x component.
YThe y component.
ZThe z component.

See Also