Click or drag to resize
DigitalRuneQuaternionF Structure
Defines a quaternion (single-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(QuaternionFConverter))]
[DataContractAttribute]
public struct QuaternionF : IEquatable<QuaternionF>

The QuaternionF type exposes the following members.

Constructors
Methods
  NameDescription
Public methodStatic memberAdd
Adds two quaternions.
Public methodStatic memberAreNumericallyEqual(QuaternionF, QuaternionF)
Tests if two quaternions are equal (within the tolerance EpsilonF).
Public methodStatic memberAreNumericallyEqual(QuaternionF, QuaternionF, Single)
Tests if two quaternions are equal (with a specific tolerance).
Public methodConjugate
Sets this quaternion to its conjugate.
Public methodStatic memberCreateRotation(Matrix33F)
Creates a unit quaternion that specifies the same rotation as the given rotation matrix.
Public methodStatic memberCreateRotation(Vector3F, Vector3F)
Creates a unit quaternion that specifies a rotation given by two vectors.
Public methodStatic memberCreateRotation(Vector3F, Single)
Creates a unit quaternion that specifies a rotation given by axis and angle.
Public methodStatic memberCreateRotation(Single, Vector3F, Single, Vector3F, Single, Vector3F, 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(QuaternionF, QuaternionF)
Divides a quaternions by another quaternion.
Public methodStatic memberDivide(QuaternionF, Single)
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(QuaternionF)
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(QuaternionF)
Calculates the exponential.
Public methodStatic memberFromXna
Converts this QuaternionF (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(QuaternionF)
Calculates the natural logarithm.
Public methodStatic memberMultiply(Single, QuaternionF)
Multiplies a quaternion by a scalar.
Public methodStatic memberMultiply(QuaternionF, QuaternionF)
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 QuaternionF equivalent.
Public methodStatic memberParse(String, IFormatProvider)
Converts the string representation of a quaternion in a specified culture-specific format to its QuaternionF equivalent.
Public methodPower(Single)
Sets this unit quaternion to a power of itself.
Public methodStatic memberPower(QuaternionF, Single)
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 float values: (w, x, y, z).
Public methodToList
Converts the vector to a list of 4 float values: (w, x, y, z).
Public methodToQuaternionD
Converts this QuaternionF to QuaternionD.
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 QuaternionF (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(QuaternionF, QuaternionF)
Divides a quaternions by another quaternion.
Public operatorStatic memberDivision(QuaternionF, Single)
Divides a quaternion by a scalar.
Public operatorStatic memberEquality
Tests if two quaternions are equal.
Public operatorStatic member(Quaternion to QuaternionF)
Performs an conversion from Quaternion (XNA Framework) to QuaternionF (DigitalRune Mathematics).
Public operatorStatic member(QuaternionF to Single)
Converts the quaternion to an array of 4 float values: (w, x, y, z).
Public operatorStatic member(QuaternionF to ListSingle)
Converts the vector to a list of 4 float values: (w, x, y, z).
Public operatorStatic member(QuaternionF to Quaternion)
Performs an conversion from QuaternionF (DigitalRune Mathematics) to Quaternion (XNA Framework).
Public operatorStatic member(QuaternionF to QuaternionD)
Performs an implicit conversion from QuaternionF to QuaternionD.
Public operatorStatic memberInequality
Tests if two quaternions are not equal.
Public operatorStatic memberMultiply(Single, QuaternionF)
Multiplies a quaternion by a scalar.
Public operatorStatic memberMultiply(QuaternionF, QuaternionF)
Multiplies two quaternions.
Public operatorStatic memberMultiply(QuaternionF, Single)
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 QuaternionF (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 QuaternionF 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(QuaternionF), require that the quaternion is a unit quaternion.

See Also