Quaternion Structure (Microsoft.DirectX)
Describes a quaternion.
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.
The following table lists the members exposed by the object.
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.
Method Description Add Adds two quaternions. BaryCentric Returns a quaternion in barycentric coordinates. Conjugate Returns the conjugate of a quaternion. 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. op_Addition Adds two quaternions. op_Equality Compares the current instance of a class to another instance to determine whether they are the same. op_Inequality Compares the current instance of a class to another instance to determine whether they are different. op_Multiply Determines the product of two quaternions. 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. RotationAxis Builds a quaternion that is rotated around an arbitrary axis. RotationMatrix Builds a quaternion from a rotation matrix. RotationYawPitchRoll Builds a quaternion with the given yaw, pitch, and roll. Slerp Interpolates between two quaternions, using spherical linear interpolation. Squad Interpolates between quaternions, using spherical quadrangle interpolation. SquadSetup Sets up control points for spherical quadrangle interpolation. Subtract Subtracts two quaternion instances. ToAxisAngle Computes a quaternion's axis and angle of rotation. ToString Obtains a string representation of the current instance.
Property Description Identity Retrieves the identity quaternion. Zero Retrieves an empty quaternion.
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)
Namespace Microsoft.DirectX Assembly Microsoft.DirectX (microsoft.directx.dll) Strong Name Microsoft.DirectX, Version=1.0.900.0, Culture=neutral, PublicKeyToken=d3231b57b74a1492