# Quaternion Structure

Defines a four-dimensional vector (x,y,z,w), which is used to efficiently rotate an object about the (x, y, z) vector by the angle theta, where w = cos(theta/2).

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

## Syntax

```public struct Quaternion
```

The Quaternion type exposes the following members.

## Constructors

NameDescription
Quaternion(Vector3, Single)Initializes a new instance of Quaternion.
Quaternion(Single, Single, Single, Single)Initializes a new instance of Quaternion.
Top

## Properties

NameDescription
IdentityReturns a Quaternion representing no rotation.
Top

## Methods

NameDescription
Concatenate(Quaternion, Quaternion)Concatenates two Quaternion instances; the result represents the value1 rotation followed by the value2 rotation.
Concatenate(Quaternion, Quaternion, Quaternion)Concatenates two Quaternion instances; the result represents the value1 rotation followed by the value2 rotation.
Conjugate()Transforms this Quaternion into its conjugate.
Conjugate(Quaternion)Returns the conjugate of a specified Quaternion.
Conjugate(Quaternion, Quaternion)Returns the conjugate of a specified Quaternion.
CreateFromAxisAngle(Vector3, Single)Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromAxisAngle(Vector3, Single, Quaternion)Creates a Quaternion from a vector and an angle to rotate about the vector.
CreateFromRotationMatrix(Matrix)Creates a Quaternion from a rotation Matrix.
CreateFromRotationMatrix(Matrix, Quaternion)Creates a Quaternion from a rotation Matrix.
CreateFromYawPitchRoll(Single, Single, Single)Creates a new Quaternion from specified yaw, pitch, and roll angles.
CreateFromYawPitchRoll(Single, Single, Single, Quaternion)Creates a new Quaternion from specified yaw, pitch, and roll angles.
Divide(Quaternion, Quaternion)Divides a Quaternion by another Quaternion.
Divide(Quaternion, Quaternion, Quaternion)Divides a Quaternion by another Quaternion.
Dot(Quaternion, Quaternion)Calculates the dot product of two Quaternion instances.
Dot(Quaternion, Quaternion, Single)Calculates the dot product of two Quaternion instances.
Equals(Object)Returns a value that indicates whether the current instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Equals(Quaternion)Determines whether the specified Object is equal to the Quaternion.
GetHashCodeGet the hash code of this object. (Overrides ValueType.GetHashCode().)
Inverse(Quaternion)Returns the inverse of a Quaternion.
Inverse(Quaternion, Quaternion)Returns the inverse of a Quaternion.
LengthCalculates the length of a Quaternion.
LengthSquaredCalculates the length squared of a Quaternion.
Lerp(Quaternion, Quaternion, Single)Linearly interpolates between two Quaternion instances.
Lerp(Quaternion, Quaternion, Single, Quaternion)Linearly interpolates between two Quaternion instances.
Multiply(Quaternion, Quaternion)Multiplies two Quaternion instances.
Multiply(Quaternion, Single)Multiplies a Quaternion by a scalar value.
Multiply(Quaternion, Quaternion, Quaternion)Multiplies two Quaternion instances.
Multiply(Quaternion, Single, Quaternion)Multiplies a Quaternion by a scalar value.
Negate(Quaternion)Flips the sign of each component of the Quaternion.
Negate(Quaternion, Quaternion)Flips the sign of each component of the Quaternion.
Normalize()Divides each component of a Quaternion by the length of the Quaternion.
Normalize(Quaternion)Divides each component of a Quaternion by the length of the Quaternion.
Normalize(Quaternion, Quaternion)Divides each component of a Quaternion by the length of the Quaternion.
Slerp(Quaternion, Quaternion, Single)Interpolates between two Quaternion instances, using spherical linear interpolation.
Slerp(Quaternion, Quaternion, Single, Quaternion)Interpolates between two Quaternion instances, using spherical linear interpolation.
Subtract(Quaternion, Quaternion)Subtracts a Quaternion from another Quaternion.
Subtract(Quaternion, Quaternion, Quaternion)Subtracts a Quaternion from another Quaternion.
ToStringRetrieves a string representation of the current object. (Overrides ValueType.ToString().)
Top

## Operators

NameDescription
DivisionDivides a Quaternion by another Quaternion.
EqualityCompares two Quaternion instances for equality.
InequalityCompare two Quaternion instances for inequality.
Multiply(Quaternion, Quaternion)Multiplies two Quaternion instances.
Multiply(Quaternion, Single)Multiplies a Quaternion by a scalar value.
SubtractionSubtracts a Quaternion from another Quaternion.
UnaryNegationFlips the sign of each component of the Quaternion.
Top

## Fields

NameDescription
WSpecifies the rotation component of the Quaternion.
XSpecifies the x-value of the vector component of the Quaternion.
YSpecifies the y-value of the vector component of the Quaternion.
ZSpecifies the z-value of the vector component of the Quaternion.
Top

## Remarks

Quaternion instances represent a rotation. Typically, they are used for smooth interpolation between two angles, and for avoiding the gimbal lock problem that can occur with euler angles.

Supported in: 5

## Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.