# Rotation

Represents a Quaternion rotation. Can be interpreted as a direction unit vector (x,y,z) + rotation around the direction vector (w) which represents the up direction.
Unlike [Angles](/api/Angles), this cannot store multiple revolutions around an axis.

- Kind: struct
- Assembly: `Sandbox.System`
- Modifiers: sealed

## Constructors

- [`Rotation`](/api/Rotation/.ctor): Initializes this rotation to identity.

## Fields

- [`Identity`](/api/Rotation/Identity): A rotation that represents no rotation.

## Properties

- [`Backward`](/api/Rotation/Backward): The backwards direction of this rotation.
- [`Conjugate`](/api/Rotation/Conjugate): Returns conjugate of this rotation, meaning the X Y and Z components are negated.
- [`Down`](/api/Rotation/Down): The downwards direction of this rotation.
- [`Forward`](/api/Rotation/Forward): The forwards direction of this rotation.
- [`Inverse`](/api/Rotation/Inverse): Returns the inverse of this rotation.
- [`IsFinite`](/api/Rotation/IsFinite): Returns true if x, y, z and w are all finite, so neither NaN nor infinity
- [`Left`](/api/Rotation/Left): The left hand direction of this rotation.
- [`Normal`](/api/Rotation/Normal): Divides each component of the rotation by its length, normalizing the rotation.
- [`Random`](/api/Rotation/Random): Returns a uniformly random rotation.
- [`Right`](/api/Rotation/Right): The right hand direction of this rotation.
- [`Up`](/api/Rotation/Up): The upwards direction of this rotation.
- [`w`](/api/Rotation/w): The W component of this rotation (rotation around the normal defined by X,Y,Z components).
- [`x`](/api/Rotation/x): The X component of this rotation.
- [`y`](/api/Rotation/y): The Y component of this rotation.
- [`z`](/api/Rotation/z): The Z component of this rotation.

## Methods

- [`AlmostEqual`](/api/Rotation/AlmostEqual): Returns true if we're nearly equal to the passed rotation. Checks if each component is within a threshold, and handles the fact that there are two ways to represent the same rotation as a quaternion.
- [`Angle`](/api/Rotation/Angle): Returns the turn length of this rotation (from identity) in degrees
- [`Angles`](/api/Rotation/Angles): Return this Rotation as pitch, yaw, roll angles
- [`Clamp`](/api/Rotation/Clamp): Clamp to within degrees of passed rotation
- [`ClosestAxis`](/api/Rotation/ClosestAxis): Will give you the axis most aligned with the given normal
- [`Difference`](/api/Rotation/Difference): Returns the difference between two rotations, as a rotation
- [`Distance`](/api/Rotation/Distance): The degree angular distance between this rotation and the target
- [`From`](/api/Rotation/From): Create a Rotation (quaternion) from Angles
- [`FromAxis`](/api/Rotation/FromAxis): Create from angle and an axis
- [`FromPitch`](/api/Rotation/FromPitch): Create a Rotation (quaternion) from pitch (degrees)
- [`FromRoll`](/api/Rotation/FromRoll): Create a Rotation (quaternion) from roll (degrees)
- [`FromToRotation`](/api/Rotation/FromToRotation): Returns a Rotation that rotates from one direction to another.
- [`FromYaw`](/api/Rotation/FromYaw): Create a Rotation (quaternion) from yaw (degrees)
- [`Lerp`](/api/Rotation/Lerp): Perform a linear interpolation from a to b by given amount.
- [`LerpTo`](/api/Rotation/LerpTo): Perform a linear interpolation from this rotation to a target rotation by given amount.
- [`LookAt`](/api/Rotation/LookAt): Create a Rotation (quaternion) from a forward and up vector
- [`Parse`](/api/Rotation/Parse): Given a string, try to convert this into a quaternion rotation. The format is "x,y,z,w"
- [`Pitch`](/api/Rotation/Pitch): Return this Rotation pitch
- [`Roll`](/api/Rotation/Roll): Return this Rotation roll
- [`RotateAroundAxis`](/api/Rotation/RotateAroundAxis): A convenience function that rotates this rotation around a given axis given amount of degrees
- [`Slerp`](/api/Rotation/Slerp): Perform a spherical interpolation from a to b by given amount.
- [`SlerpTo`](/api/Rotation/SlerpTo): Perform a spherical interpolation from this rotation to a target rotation by given amount.
- [`SmoothDamp`](/api/Rotation/SmoothDamp): Smoothly move towards the target rotation
- [`TryParse`](/api/Rotation/TryParse)
- [`Yaw`](/api/Rotation/Yaw): Return this Rotation yaw
