# QuaternionQuaternionQuaternionQuaternion Struct

## Definition

Represents a vector that is used to encode three-dimensional physical rotations.

``public value class Quaternion : IEquatable<System::Numerics::Quaternion>``
``public struct Quaternion : IEquatable<System.Numerics.Quaternion>``
``type Quaternion = struct``
``````Public Structure Quaternion
Implements IEquatable(Of Quaternion)``````
Inheritance
QuaternionQuaternionQuaternionQuaternion
Implements

## Remarks

The Quaternion structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where:

``````w = cos(theta/2)
``````

## Constructors

 Quaternion(Vector3, Single) Quaternion(Vector3, Single) Quaternion(Vector3, Single) Quaternion(Vector3, Single) Creates a quaternion from the specified vector and rotation parts. Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single) Quaternion(Single, Single, Single, Single) Constructs a quaternion from the specified components.

## Fields

 W W W W The rotation component of the quaternion. X X X X The X value of the vector component of the quaternion. Y Y Y Y The Y value of the vector component of the quaternion. Z Z Z Z The Z value of the vector component of the quaternion.

## Properties

 Identity Identity Identity Identity Gets a quaternion that represents no rotation. IsIdentity IsIdentity IsIdentity IsIdentity Gets a value that indicates whether the current instance is the identity quaternion.

## Methods

 Add(Quaternion, Quaternion) Add(Quaternion, Quaternion) Add(Quaternion, Quaternion) Add(Quaternion, Quaternion) Adds each element in one quaternion with its corresponding element in a second quaternion. Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion) Concatenate(Quaternion, Quaternion) Concatenates two quaternions. Conjugate(Quaternion) Conjugate(Quaternion) Conjugate(Quaternion) Conjugate(Quaternion) Returns the conjugate of a specified quaternion. CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single) CreateFromAxisAngle(Vector3, Single) Creates a quaternion from a unit vector and an angle to rotate around the vector. CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4) CreateFromRotationMatrix(Matrix4x4) Creates a quaternion from the specified rotation matrix. CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single) CreateFromYawPitchRoll(Single, Single, Single) Creates a new quaternion from the given yaw, pitch, and roll. Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion) Divide(Quaternion, Quaternion) Divides one quaternion by a second quaternion. Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion) Dot(Quaternion, Quaternion) Calculates the dot product of two quaternions. Equals(Quaternion) Equals(Quaternion) Equals(Quaternion) Equals(Quaternion) Returns a value that indicates whether this instance and another quaternion are equal. Equals(Object) Equals(Object) Equals(Object) Equals(Object) Returns a value that indicates whether this instance and a specified object are equal. GetHashCode() GetHashCode() GetHashCode() GetHashCode() Returns the hash code for this instance. Inverse(Quaternion) Inverse(Quaternion) Inverse(Quaternion) Inverse(Quaternion) Returns the inverse of a quaternion. Length() Length() Length() Length() Calculates the length of the quaternion. LengthSquared() LengthSquared() LengthSquared() LengthSquared() Calculates the squared length of the quaternion. Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single) Lerp(Quaternion, Quaternion, Single) Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Returns the quaternion that results from multiplying two quaternions together. Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. Negate(Quaternion) Negate(Quaternion) Negate(Quaternion) Negate(Quaternion) Reverses the sign of each component of the quaternion. Normalize(Quaternion) Normalize(Quaternion) Normalize(Quaternion) Normalize(Quaternion) Divides each component of a specified Quaternion by its length. Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single) Slerp(Quaternion, Quaternion, Single) Interpolates between two quaternions, using spherical linear interpolation. Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion) Subtract(Quaternion, Quaternion) Subtracts each element in a second quaternion from its corresponding element in a first quaternion. ToString() ToString() ToString() ToString() Returns a string that represents this quaternion.

## Operators

 Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion) Addition(Quaternion, Quaternion) Adds each element in one quaternion with its corresponding element in a second quaternion. Division(Quaternion, Quaternion) Division(Quaternion, Quaternion) Division(Quaternion, Quaternion) Division(Quaternion, Quaternion) Divides one quaternion by a second quaternion. Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion) Equality(Quaternion, Quaternion) Returns a value that indicates whether two quaternions are equal. Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion) Inequality(Quaternion, Quaternion) Returns a value that indicates whether two quaternions are not equal. Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Multiply(Quaternion, Single) Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Multiply(Quaternion, Quaternion) Returns the quaternion that results from multiplying two quaternions together. Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion) Subtraction(Quaternion, Quaternion) Subtracts each element in a second quaternion from its corresponding element in a first quaternion. UnaryNegation(Quaternion) UnaryNegation(Quaternion) UnaryNegation(Quaternion) UnaryNegation(Quaternion) Reverses the sign of each component of the quaternion.