# Quaternion 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
Quaternion
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

 Constructs a quaternion from the specified components. Creates a quaternion from the specified vector and rotation parts.

## Fields

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

## Properties

 Gets a quaternion that represents no rotation. Gets a value that indicates whether the current instance is the identity quaternion. Gets or sets the element at the specified index. Gets a quaternion that represents a zero.

## Methods

 Adds each element in one quaternion with its corresponding element in a second quaternion. Concatenates two quaternions. Returns the conjugate of a specified quaternion. Creates a quaternion from a unit vector and an angle to rotate around the vector. Creates a quaternion from the specified rotation matrix. Creates a new quaternion from the given yaw, pitch, and roll. Divides one quaternion by a second quaternion. Calculates the dot product of two quaternions. Returns a value that indicates whether this instance and a specified object are equal. Returns a value that indicates whether this instance and another quaternion are equal. Returns the hash code for this instance. Returns the inverse of a quaternion. Calculates the length of the quaternion. Calculates the squared length of the quaternion. Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. Returns the quaternion that results from multiplying two quaternions together. Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. Reverses the sign of each component of the quaternion. Divides each component of a specified Quaternion by its length. Interpolates between two quaternions, using spherical linear interpolation. Subtracts each element in a second quaternion from its corresponding element in a first quaternion. Returns a string that represents this quaternion.

## Operators

 Adds each element in one quaternion with its corresponding element in a second quaternion. Divides one quaternion by a second quaternion. Returns a value that indicates whether two quaternions are equal. Returns a value that indicates whether two quaternions are not equal. Returns the quaternion that results from multiplying two quaternions together. Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. Subtracts each element in a second quaternion from its corresponding element in a first quaternion. Reverses the sign of each component of the quaternion.