Click or drag to resize

Quaternion Structure

A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space. In general, UnitQuaternion is used to represent rotations. This type is available for completeness, providing quaternion operations on non-normalized quaternions.

Namespace:  AGI.Foundation.Coordinates
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public struct Quaternion : IEquatable<Quaternion>, 
	IEquatableEpsilon<Quaternion>

The Quaternion type exposes the following members.

Constructors
  NameDescription
Public methodQuaternion(AngleAxisRotation)
Initializes a set of Quaternion coordinates from the provided AngleAxisRotation.
Public methodQuaternion(Double)
Initializes a set of Quaternion coordinates from the first 4 consecutive elements in the provided array.
Public methodQuaternion(ElementaryRotation)
Initializes a set of Quaternion coordinates from the provided ElementaryRotation.
Public methodQuaternion(EulerSequence)
Initializes a set of Quaternion coordinates from the provided EulerSequence.
Public methodQuaternion(Matrix3By3)
Initializes a set of Quaternion coordinates from the provided Matrix3By3.
Public methodQuaternion(YawPitchRoll)
Initializes a set of Quaternion coordinates from the provided YawPitchRoll.
Public methodQuaternion(Double, Int32)
Initializes a set of Quaternion coordinates from 4 consecutive elements in the provided array.
Public methodQuaternion(Double, Double, Double, Double)
Initializes a set of Quaternion coordinates from the provided values.
Top
Properties
  NameDescription
Public propertyHasZeroNorm
Gets a value indicating whether the Norm of this instance is zero.
Public propertyStatic memberIdentity
Gets the set of Quaternion coordinates representing the identity vector.
Public propertyIsUndefined
Gets a value indicating whether or not any of the coordinates for this instance have the value NaN.
Public propertyItem
Gets the value of the specified element with index of 0, 1, 2, and 3 corresponding to the coordinates W, X, Y, and Z.
Public propertyLength
Gets the number of elements in this set of coordinates.
Public propertyNorm
Gets the norm of this instance.
Public propertyNormSquared
Gets the square of the Norm of this instance.
Public propertyStatic memberUndefined
Gets a set of Quaternion coordinates with values of NaN.
Public propertyW
Gets the W coordinate.
Public propertyX
Gets the X coordinate.
Public propertyY
Gets the Y coordinate.
Public propertyZ
Gets the Z coordinate.
Public propertyStatic memberZero
Gets a set of Quaternion coordinates with values of zero.
Top
Methods
  NameDescription
Public methodConjugate
Forms the conjugate of this instance, yielding a new Quaternion.
Public methodEquals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Quaternion)
Indicates whether another instance of this type is exactly equal to this instance.
Public methodEqualsEpsilon
Indicates whether each coordinate value of another instance of this type is within the required tolerance of the corresponding coordinate value of this instance.
Public methodGetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodMultiply(Double)
Multiplies this instance by a scalar, yielding a new Quaternion.
Public methodMultiply(ElementaryRotation)
Multiplies this instance by the specified ElementaryRotation, yielding a new Quaternion.
Public methodMultiply(Quaternion)
Multiplies this instance by the specified Quaternion, yielding a new Quaternion.
Public methodNormalize
Forms a set of UnitQuaternion coordinates from this instance.
Public methodNormalize(Double)
Forms a set of UnitQuaternion coordinates from this instance and returns the magnitude of the original instance in the provided parameter.
Public methodToString
Returns the string representation of the value of this instance.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Returns if the two instances are exactly equal.
Public operatorStatic member(UnitQuaternion to Quaternion)
Converts a set of UnitQuaternion coordinates to a set of Quaternion coordinates.
Public operatorStatic memberInequality
Returns if the two instances are not exactly equal.
Public operatorStatic memberMultiply(Double, Quaternion)
Multiplies a scalar by a specified Quaternion, yielding a new Quaternion.
Public operatorStatic memberMultiply(Quaternion, ElementaryRotation)
Multiplies a specified Quaternion by a specified ElementaryRotation, yielding a new Quaternion.
Public operatorStatic memberMultiply(Quaternion, Quaternion)
Multiplies a specified Quaternion by another specified Quaternion, yielding a new Quaternion.
Public operatorStatic memberMultiply(Quaternion, Double)
Multiplies a specified Quaternion by a scalar, yielding a new Quaternion.
Public operatorStatic memberUnaryNegation
Negates the specified Quaternion, yielding a new Quaternion.
Top
Remarks
For more information on how quaternions and other coordinates are used to represent rotations, see the Coordinates topic.
See Also