Quaternion Structure (Microsoft.DirectX)

Describes a quaternion.

Definition

Visual Basic Public Structure Quaternion
C# public struct Quaternion 
C++ public value class Quaternion sealed 
JScript In JScript, you can use structures, but you cannot define your own.

Members Table

The following table lists the members exposed by the object.

Fields

Field Description
W Retrieves or sets the w component of the quaternion.
X Retrieves or sets the x component of the quaternion.
Y Retrieves or sets the y component of the quaternion.
Z Retrieves or sets the z component of the quaternion.

Methods

Method Description
static (Shared in Visual Basic) Add Adds two quaternions.
static (Shared in Visual Basic) BaryCentric Returns a quaternion in barycentric coordinates.
static (Shared in Visual Basic) Conjugate Returns the conjugate of a quaternion.
static (Shared in Visual Basic) Dot Returns the dot product of two quaternions.
Equals Returns a value that indicates whether the current instance is equal to a specified object.
Exp Calculates the exponential.
GetHashCode Returns the hash code for the current instance.
Invert Conjugates and re-normalizes a quaternion.
Length Returns the length of a quaternion.
LengthSq Returns the square of a quaternion's length.
Ln Calculates the natural logarithm.
Multiply Multiplies two quaternions.
Normalize Returns the normal of a quaternion.
static (Shared in Visual Basic) op_Addition Adds two quaternions.
static (Shared in Visual Basic) op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
static (Shared in Visual Basic) op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
static (Shared in Visual Basic) op_Multiply Determines the product of two quaternions.
static (Shared in Visual Basic) op_Subtraction Subtracts two quaternions.
Quaternion Initializes a new instance of the Quaternion class.
RotateAxis Rotates a quaternion around an arbitrary axis.
RotateMatrix Builds a quaternion from a rotation matrix.
RotateYawPitchRoll Builds a quaternion with the given yaw, pitch, and roll.
static (Shared in Visual Basic) RotationAxis Builds a quaternion that is rotated around an arbitrary axis.
static (Shared in Visual Basic) RotationMatrix Builds a quaternion from a rotation matrix.
static (Shared in Visual Basic) RotationYawPitchRoll Builds a quaternion with the given yaw, pitch, and roll.
static (Shared in Visual Basic) Slerp Interpolates between two quaternions, using spherical linear interpolation.
static (Shared in Visual Basic) Squad Interpolates between quaternions, using spherical quadrangle interpolation.
static (Shared in Visual Basic) SquadSetup Sets up control points for spherical quadrangle interpolation.
static (Shared in Visual Basic) Subtract Subtracts two quaternion instances.
static (Shared in Visual Basic) ToAxisAngle Computes a quaternion's axis and angle of rotation.
ToString Obtains a string representation of the current instance.

Properties

Property Description
static (Shared in Visual Basic) Identity Retrieves the identity quaternion.
static (Shared in Visual Basic) Zero Retrieves an empty quaternion.

Remarks

Quaternions add a fourth element to the [ x, y, z] values that define a vector, resulting in arbitrary 4-D vectors. However, the following example illustrates how each element of a unit quaternion relates to an axis-angle rotation, where q represents a unit quaternion (x, y, z, w), axis is normalized, and theta is the desired counterclockwise (CCW) rotation around the axis.

q.x = sin(theta/2) * axis.x

q.y = sin(theta/2) * axis.y

q.z = sin(theta/2) * axis.z

q.w = cos(theta/2)

Structure Information

Namespace Microsoft.DirectX
Assembly Microsoft.DirectX (microsoft.directx.dll)
Strong Name Microsoft.DirectX,  Version=1.0.900.0,  Culture=neutral,  PublicKeyToken=d3231b57b74a1492

See Also