Click or drag to resize
DigitalRuneQuaternionD Structure
Defines a quaternion (double-precision).

Namespace: DigitalRune.Mathematics.Algebra
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
[SerializableAttribute]
[TypeConverterAttribute(typeof(QuaternionDConverter))]
[DataContractAttribute]
public struct QuaternionD : IEquatable<QuaternionD>

The QuaternionD type exposes the following members.

Constructors
Methods
  NameDescription
Public methodStatic memberAdd
Adds two quaternions.
Public methodStatic memberAreNumericallyEqual(QuaternionD, QuaternionD)
Tests if two quaternions are equal (within the tolerance EpsilonD).
Public methodStatic memberAreNumericallyEqual(QuaternionD, QuaternionD, Double)
Tests if two quaternions are equal (with a specific tolerance).
Public methodConjugate
Sets this quaternion to its conjugate.
Public methodStatic memberCreateRotation(Matrix33D)
Creates a unit quaternion that specifies the same rotation as the given rotation matrix.
Public methodStatic memberCreateRotation(Vector3D, Vector3D)
Creates a unit quaternion that specifies a rotation given by two vectors.
Public methodStatic memberCreateRotation(Vector3D, Double)
Creates a unit quaternion that specifies a rotation given by axis and angle.
Public methodStatic memberCreateRotation(Double, Vector3D, Double, Vector3D, Double, Vector3D, Boolean)
Gets an orientation quaternion from Euler angles (3 rotations around 3 axes).
Public methodStatic memberCreateRotationX
Creates a unit quaternion that specifies a rotation by a given angle around the x-axis.
Public methodStatic memberCreateRotationY
Creates a unit quaternion that specifies a rotation by a given angle around the y-axis.
Public methodStatic memberCreateRotationZ
Creates a unit quaternion that specifies a rotation by a given angle around the z-axis.
Public methodStatic memberDivide(QuaternionD, QuaternionD)
Divides a quaternions by another quaternion.
Public methodStatic memberDivide(QuaternionD, Double)
Divides a quaternion by a scalar.
Public methodStatic memberDot
Returns the dot product of two quaternions.
Public methodEquals(Object)
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(QuaternionD)
Indicates whether the current object is equal to another object of the same type.
Public methodExp
Sets this quaternion to its exponential.
Public methodStatic memberExp(QuaternionD)
Calculates the exponential.
Public methodStatic memberFromXna
Converts this QuaternionD (DigitalRune Mathematics) to Quaternion (XNA Framework).
Public methodStatic memberGetAngle
Calculates the angle between two quaternions.
Public methodGetHashCode
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInvert
Inverts the quaternion.
Public methodLn
Sets this quaternion to its natural logarithm.
Public methodStatic memberLn(QuaternionD)
Calculates the natural logarithm.
Public methodStatic memberMultiply(Double, QuaternionD)
Multiplies a quaternion by a scalar.
Public methodStatic memberMultiply(QuaternionD, QuaternionD)
Multiplies two quaternions.
Public methodStatic memberNegate
Negates a quaternion.
Public methodNormalize
Normalizes the quaternion.
Public methodStatic memberParse(String)
Converts the string representation of a quaternion to its QuaternionD equivalent.
Public methodStatic memberParse(String, IFormatProvider)
Converts the string representation of a quaternion in a specified culture-specific format to its QuaternionD equivalent.
Public methodPower(Double)
Sets this unit quaternion to a power of itself.
Public methodStatic memberPower(QuaternionD, Double)
Calculates the power of a unit quaternion.
Public methodRotate
Rotates a vector.
Public methodStatic memberSubtract
Subtracts a quaternion from a quaternion.
Public methodToArray
Converts the quaternion to an array of 4 double values: (w, x, y, z).
Public methodToList
Converts the vector to a list of 4 double values: (w, x, y, z).
Public methodToQuaternionF
Converts this QuaternionD to QuaternionF.
Public methodToRotationMatrix33
Returns the 3 x 3 rotation matrix of this quaternion.
Public methodToRotationMatrix44
Returns the 4 x 4 rotation matrix of this quaternion.
Public methodToString
Returns the string representation of this quaternion.
(Overrides ValueTypeToString.)
Public methodToString(IFormatProvider)
Returns the string representation of this vector using the specified culture-specific format information.
Public methodToXna
Converts this QuaternionD (DigitalRune Mathematics) to Quaternion (XNA Framework).
Public methodTryNormalize
Tries to normalize the quaternion.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds two quaternions.
Public operatorStatic memberDivision(QuaternionD, QuaternionD)
Divides a quaternions by another quaternion.
Public operatorStatic memberDivision(QuaternionD, Double)
Divides a quaternion by a scalar.
Public operatorStatic memberEquality
Tests if two quaternions are equal.
Public operatorStatic member(Quaternion to QuaternionD)
Performs an conversion from Quaternion (XNA Framework) to QuaternionD (DigitalRune Mathematics).
Public operatorStatic member(QuaternionD to Double)
Converts the quaternion to an array of 4 double values: (w, x, y, z).
Public operatorStatic member(QuaternionD to ListDouble)
Converts the vector to a list of 4 double values: (w, x, y, z).
Public operatorStatic member(QuaternionD to QuaternionF)
Performs an explicit conversion from QuaternionD to QuaternionF.
Public operatorStatic member(QuaternionD to Quaternion)
Performs an conversion from QuaternionD (DigitalRune Mathematics) to Quaternion (XNA Framework).
Public operatorStatic memberInequality
Tests if two quaternions are not equal.
Public operatorStatic memberMultiply(Double, QuaternionD)
Multiplies a quaternion by a scalar.
Public operatorStatic memberMultiply(QuaternionD, QuaternionD)
Multiplies two quaternions.
Public operatorStatic memberMultiply(QuaternionD, Double)
Multiplies a quaternion by a scalar.
Public operatorStatic memberSubtraction
Subtracts a quaternion from a quaternion.
Public operatorStatic memberUnaryNegation
Negates a quaternion.
Top
Fields
  NameDescription
Public fieldStatic memberIdentity
Returns the identity QuaternionD (1, 0, 0, 0).
Public fieldW
The w component.
Public fieldX
The x component.
Public fieldY
The y component.
Public fieldZ
The z component.
Public fieldStatic memberZero
Returns a QuaternionD with all of its components set to zero.
Top
Properties
  NameDescription
Public propertyAngle
Gets or sets the angle of the rotation around Axis.
Public propertyAxis
Gets or sets the normalized unit vector with the direction of the rotation axis.
Public propertyConjugated
Returns the conjugate of the quaternion.
Public propertyInverse
Returns the inverse of this quaternion.
Public propertyIsNaN
Gets a value indicating whether a component of the quaternion is NaN.
Public propertyIsNumericallyNormalized
Returns a value indicating whether this quaternion is normalized (the Modulus is numerically equal to 1).
Public propertyItem
Gets or sets the component at the specified index.
Public propertyModulus
Returns the modulus (length).
Public propertyNorm
Returns the norm (length2).
Public propertyNormalized
Returns the normalized quaternion.
Public propertyV
Gets or sets the vector part (x, y, z).
Top
Remarks

A quaternion consists of a scalar component w and a vector component v = (x, y, z). Alternatively it can be represented as a complex number with three imaginary parts w + ix + jy + kz, or as a 4-dimensional vector (w, x, y, z)

Due to common notation, the quaternion components are stored in the order: (w, x, y, z).

Unit Quaternions:

A unit quaternion is a quaternion q where N(q) = 1. (See Norm.) A unit quaternion can be represented by

q = cosθ + usinθ,

where u as a 3D vector has a length of 1. By applying Euler's identity for complex numbers the quaternion can be written in exponential notation:

q = euθ = cosθ + usinθ

Several methods, such as Ln(QuaternionD), require that the quaternion is a unit quaternion.

See Also