Click or drag to resize

UnitQuaternion Structure

A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space. This represents an 'alias' rotation which transforms coordinates by modifying the underlying coordinate basis rather than modifying the coordinates themselves. To transform a Cartesian with this rotation, see Rotate(UnitQuaternion).

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

The UnitQuaternion type exposes the following members.

Constructors
  NameDescription
Public methodUnitQuaternion(AngleAxisRotation)
Initializes a set of UnitQuaternion coordinates from the provided AngleAxisRotation.
Public methodUnitQuaternion(Double)
Initializes a set of UnitQuaternion coordinates from the first 4 consecutive elements in the provided array. Note that the elements will not be normalized and may represent an invalid unit quaternion.
Public methodUnitQuaternion(ElementaryRotation)
Initializes a set of UnitQuaternion coordinates from the provided ElementaryRotation.
Public methodUnitQuaternion(EulerSequence)
Initializes a set of UnitQuaternion coordinates from the provided EulerSequence.
Public methodUnitQuaternion(Matrix3By3)
Initializes a set of UnitQuaternion coordinates from the provided rotation matrix (Matrix3By3). Note that if the given matrix is not an orthogonal rotation matrix, it will create a non-unit UnitQuaternion and could cause problems in code which assumes that the UnitQuaternion represents a rotation.
Public methodUnitQuaternion(Quaternion)
Initializes a set of UnitQuaternion coordinates from the provided set of Quaternion coordinates.
Public methodUnitQuaternion(YawPitchRoll)
Initializes a set of UnitQuaternion coordinates from the provided YawPitchRoll.
Public methodUnitQuaternion(Double, Int32)
Initializes a set of UnitQuaternion coordinates from 4 consecutive elements in the provided array. Note that the elements will not be normalized and may represent an invalid unit quaternion.
Public methodUnitQuaternion(Double, Double, Double, Double)
Initializes a set of UnitQuaternion coordinates from the provided values.
Public methodUnitQuaternion(Double, Double, Double, Double, Double)
Initializes a set of UnitQuaternion coordinates from the provided values.
Top
Properties
  NameDescription
Public propertyStatic memberIdentity
Gets a set of UnitQuaternion 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 propertyStatic memberUndefined
Gets a set of UnitQuaternion 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.
Top
Methods
  NameDescription
Public methodConjugate
Forms the conjugate of this instance.
Public methodEquals(Object)
Indicates whether another object is exactly equal to this instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(UnitQuaternion)
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 methodIsEquivalent(UnitQuaternion)
Indicates whether another instance of this type is mathematically equivalent to this instance. Instances are equivalent if each coordinate value of one instance is equal to the corresponding coordinate value of the other instance, or if each coordinate value of one instance is the opposite of the corresponding coordinate value of the other instance.
Public methodIsEquivalent(UnitQuaternion, Double)
Indicates whether another instance of this type is mathematically equivalent to this instance, within the required tolerance. Instances are equivalent if each coordinate value of one instance is equal to the corresponding coordinate value of the other instance, or if each coordinate value of one instance is the opposite of the corresponding coordinate value of the other instance.
Public methodMultiply(Double)
Multiplies this instance by a scalar.
Public methodMultiply(ElementaryRotation)
Multiplies this instance by the specified ElementaryRotation, yielding a new UnitQuaternion.
Public methodMultiply(UnitQuaternion)
Multiplies this instance by the specified UnitQuaternion, yielding a new UnitQuaternion.
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 memberInequality
Returns if the two instances are not exactly equal.
Public operatorStatic memberMultiply(Double, UnitQuaternion)
Multiplies a scalar by a specified UnitQuaternion, yielding a new Quaternion.
Public operatorStatic memberMultiply(UnitQuaternion, ElementaryRotation)
Multiplies a specified UnitQuaternion by a specified ElementaryRotation, yielding a new UnitQuaternion.
Public operatorStatic memberMultiply(UnitQuaternion, UnitQuaternion)
Multiplies a specified UnitQuaternion by another specified UnitQuaternion, yielding a new UnitQuaternion.
Public operatorStatic memberMultiply(UnitQuaternion, Double)
Multiplies a specified UnitQuaternion by a scalar, yielding a new Quaternion.
Public operatorStatic memberUnaryNegation
Negates the specified UnitQuaternion, yielding a new UnitQuaternion.
Top
Remarks

For more information on how quaternions and other coordinates are used to represent rotations, see the Coordinates topic.

The normalization of the quaternion is accomplished in the usual way. It should be noted that this does not guarantee a result whose magnitude will be 1.0 in cases where an individual component underflows upon squaring.

See Also