  # 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: 19.1.398.0 (19.1.398.0) Syntax
`public struct Quaternion : IEquatable<Quaternion>`

The Quaternion type exposes the following members. Constructors
NameDescription Quaternion(Double)
Initializes a set of Quaternion coordinates from the first 4 consecutive elements in the provided array. Quaternion(AngleAxisRotation)
Initializes a set of Quaternion coordinates from the provided AngleAxisRotation. Quaternion(ElementaryRotation)
Initializes a set of Quaternion coordinates from the provided ElementaryRotation. Quaternion(EulerSequence)
Initializes a set of Quaternion coordinates from the provided EulerSequence. Quaternion(Matrix3By3)
Initializes a set of Quaternion coordinates from the provided Matrix3By3. Quaternion(YawPitchRoll)
Initializes a set of Quaternion coordinates from the provided YawPitchRoll. Quaternion(Double, Int32)
Initializes a set of Quaternion coordinates from 4 consecutive elements in the provided array. Quaternion(Double, Double, Double, Double)
Initializes a set of Quaternion coordinates from the provided values.
Top Properties
NameDescription HasZeroNorm
Gets a value indicating if the Norm of this instance is zero.  Identity
Gets the set of Quaternion coordinates representing the identity vector. IsUndefined
Gets whether or not any of the coordinates for this instance have the value NaN. Item
Gets the value of the specified element with index of 0, 1, 2, and 3 corresponding to the coordinates W, X, Y, and Z. Length
Gets the number of elements in this set of coordinates. Norm
Gets the norm of this instance. NormSquared
Gets the square of the Norm of this instance.  Undefined
Gets a set of Quaternion coordinates with values of NaN. W
Gets the W coordinate. X
Gets the X coordinate. Y
Gets the Y coordinate. Z
Gets the Z coordinate.  Zero
Gets a set of Quaternion coordinates with values of zero.
Top Methods
NameDescription Conjugate
Forms the conjugate of this instance, yielding a new Quaternion. Equals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ValueTypeEquals(Object).) Equals(Quaternion)
Indicates whether another instance of this type is exactly equal to this instance. EqualsEpsilon
Indicates whether each coordinate value of another instance of this type is within the required tolerance of the corresponding coordinate value of this instance. GetHashCode
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
(Overrides ValueTypeGetHashCode.) GetType
Gets the Type of the current instance.
(Inherited from Object.) Multiply(Double)
Multiplies this instance by a scalar, yielding a new Quaternion. Multiply(ElementaryRotation)
Multiplies this instance by the specified ElementaryRotation, yielding a new Quaternion. Multiply(Quaternion)
Multiplies this instance by the specified Quaternion, yielding a new Quaternion. Normalize
Forms a set of UnitQuaternion coordinates from this instance. Normalize(Double)
Forms a set of UnitQuaternion coordinates from this instance and returns the magnitude of the original instance in the provided parameter. ToString
Returns the string representation of the value of this instance.
(Overrides ValueTypeToString.)
Top Operators
NameDescription  Equality
Returns if the two instances are exactly equal.  (UnitQuaternion to Quaternion)
Converts a set of UnitQuaternion coordinates to a set of Quaternion coordinates.  Inequality
Returns if the two instances are not exactly equal.  Multiply(Double, Quaternion)
Multiplies a scalar by a specified Quaternion, yielding a new Quaternion.  Multiply(Quaternion, ElementaryRotation)
Multiplies a specified Quaternion by a specified ElementaryRotation, yielding a new Quaternion.  Multiply(Quaternion, Quaternion)
Multiplies a specified Quaternion by another specified Quaternion, yielding a new Quaternion.  Multiply(Quaternion, Double)
Multiplies a specified Quaternion by a scalar, yielding a new Quaternion.  UnaryNegation
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