# Quaternion

A Quaternion represents rotation and direction in 3D space, consisting of x, y, z, and w components. They are crucial for 3D movement and rotation, offering advantages such as avoiding gimbal lock.

## Properties

Returns the rotation of a Quaternion in Euler angles representation.

Returns a normalized copy of the Quaternion.

Represents the x component of the Quaternion.

Represents the y component of the Quaternion.

Represents the z component of the Quaternion.

Represents the w (scalar) component of the Quaternion.

Represents a Quaternion for no rotation.

Represents a small number greater than zero for comparison.

## Methods

Assigns new values to the Quaternion's components.

#### Parameters

##### newX

The new x component.

##### newY

The new y component.

##### newZ

The new z component.

##### newW

The new w component.

#### Returns

Aligns the Quaternion's z-axis towards a target direction.

#### Parameters

##### view

Vector3The target direction vector.

#### Returns

Sets the Quaternion to rotate from one direction to another.

Modifies the quaternion to a unit length version of itself.

#### Returns

Creates a Quaternion that rotates from one direction to another.

#### Returns

A rotation from fromDirection to toDirection.

Returns the inverse of the Quaternion.

#### Parameters

##### rotation

QuaternionThe rotation to inverse.

#### Returns

The inverse rotation.

Gradually changes a Quaternion from one rotation to another.

#### Parameters

#### Returns

An interpolated quaternion rotation.

Interpolates a Quaternion over an arbitrary range.

#### Parameters

#### Returns

An interpolated quaternion rotation.

Linearly interpolates between two quaternions.

#### Parameters

#### Returns

An interpolated quaternion rotation.

The 'LerpUnclamped' method is similar to Lerp, but here the interpolation factor isn't clamped to the range [0, 1].

#### Parameters

#### Returns

Returns a Quaternion that is interpolated over an arbitrary range.

Creates a Quaternion rotation around an axis by a specified angle.

#### Parameters

##### angle

The angle of rotation.

##### axis

Vector3The rotation axis.

#### Returns

A Quaternion around the specified axis with the given angle.

Provides a quaternion that makes an object face towards a specified direction.

#### Parameters

#### Returns

A Quaternion that aligns an object's forward direction towards the specified direction.

Calculates the dot product of two quaternions.

#### Parameters

The first quaternion.

The second quaternion.

#### Returns

The dot product of the two quaternions.

Returns the angle in degrees between two rotations.

#### Parameters

The first rotation.

The second rotation.

#### Returns

The angle in degrees between the two rotations.

Creates a Quaternion rotation from Euler angles.

#### Parameters

##### x

The angle around the x-axis in degrees.

##### y

The angle around the y-axis in degrees.

##### z

The angle around the z-axis in degrees.

#### Returns

A Quaternion from the Euler angles.

Gradually changes a Quaternion towards a target rotation.

#### Parameters

##### from

QuaternionThe current rotation.

The target rotation.

##### maxDegreesDelta

The maximum number of degrees to rotate by in each call.

#### Returns

A Quaternion rotated towards the target.

Modifies the quaternion to a unit length version of itself.

#### Parameters

The Quaternion to be normalized.

#### Returns

The normalized version of the quaternion.