> For the complete documentation index, see [llms.txt](https://docs.engagevr.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.engagevr.io/developer/afx/node-dictionary/variable/vector/quaternion.md).

# Quaternion

## Cast > Quaternion to Euler

Converts a quaternion rotation to a Euler representation.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Euler Angles</td><td>Vector3</td><td>Euler angle rotation.</td></tr></tbody></table>

## Cast > Quaternion to String

Converts a quaternion rotation to a string.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>String</td><td>String representation of the quaternion in the format <code>(X, Y, Z, W)</code>.</td></tr></tbody></table>

## Build Quaternion

Creates a quaternion data type.

**Inputs:**

<table><thead><tr><th width="169">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>X In</td><td>Float [editable]</td><td>X component of the quaternion.</td></tr><tr><td>Y In</td><td>Float [editable]</td><td>Y component of the quaternion.</td></tr><tr><td>Z In</td><td>Float [editable]</td><td>Z component of the quaternion.</td></tr><tr><td>W In</td><td>Float [editable]</td><td>W component of the quaternion.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="169">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion Out</td><td>Quaternion</td><td>The constructed quaternion.</td></tr></tbody></table>

## Get Quaternion

Converts a quaternion component to a quaternion data type.

**Inputs:**

<table><thead><tr><th width="165">Name</th><th width="157">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion Component</td><td>Quaternion Component</td><td>Reference to a quaternion component.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="169">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion Out</td><td>Quaternion</td><td>Quaternion rotation.</td></tr></tbody></table>

## Quaternion Set From To Rotation

Creates a rotation which rotates between `From` and `To`. Inputs are in Euler angles. For example, from the transforms of two objects.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>Vector3 [editable]</td><td>Starting direction in Euler angles.</td></tr><tr><td>To</td><td>Vector3 [editable]</td><td>Target direction in Euler angles.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Quaternion rotation that describes the rotation required to change between <code>From</code> and <code>To</code>.</td></tr></tbody></table>

## Quaternion Angle

Calculates the angle of the shortest rotation between two quaternion rotations.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion A</td><td>Quaternion</td><td>First rotation.</td></tr><tr><td>Quaternion B</td><td>Quaternion</td><td>Second rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Angle</td><td>Float</td><td>The angle in degrees between <code>Quaternion A</code> and <code>Quaternion B</code>.</td></tr></tbody></table>

## Quaternion Angle Axis

Creates a rotation which rotates a given number of degrees around a given axis.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="164">Type</th><th>Description</th></tr></thead><tbody><tr><td>Angle</td><td>Float [editable]</td><td>The angle to rotate by.</td></tr><tr><td>Axis</td><td>Vector3 [editable]</td><td>The axis to rotate around.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation that represents a rotation around <code>Axis</code> by <code>Angle</code> degree.</td></tr></tbody></table>

## Quaternion Dot

The dot product between two rotations.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Quaternion</td><td>First rotation.</td></tr><tr><td>B</td><td>Quaternion</td><td>Second rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>The dot product between A and B.</td></tr></tbody></table>

## Quaternion Euler

Converts a Euler angle rotation to a quaternion.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="168">Type</th><th>Description</th></tr></thead><tbody><tr><td>Euler</td><td>Vector3 [editable]</td><td>Euler angle rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="173">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion representation of the <code>Euler</code> input.</td></tr></tbody></table>

## Quaternion From To Rotation

Creates a rotation which rotates between `From` and `To`. Inputs are in Euler angles. For example, from the transforms of two objects.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>Vector3 [editable]</td><td>Starting direction in Euler angles.</td></tr><tr><td>To</td><td>Vector3 [editable]</td><td>Target direction in Euler angles.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="169">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation that describes the rotation required to change between <code>From</code> and <code>To</code>.</td></tr></tbody></table>

## Get Quaternion Normalized

Converts this quaternion to a quaternion with the same orientation but with a magnitude of 1.0.

**Inputs:**

<table><thead><tr><th width="170">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion In</td><td>Quaternion</td><td>Quaternion with any magnitude.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="173">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion Out</td><td>Quaternion</td><td>Quaternion with a magnitude of 1.0.</td></tr></tbody></table>

## Quaternion Inverse

Outputs the inverse of a rotation.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Starting rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Inverse of the <code>Quaternion</code> input.</td></tr></tbody></table>

## Quaternion Lerp

Interpolates between A and B by T and normalizes the result afterwards.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Quaternion</td><td>Starting quaternion. Output when T=0.</td></tr><tr><td>B</td><td>Quaternion</td><td>Ending quaternion. Output when T=1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>Interpolation value. Clamped in the range 0 to 1.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Interpolated quaternion.</td></tr></tbody></table>

## Quaternion Lerp Unclamped

Interpolates between A and B by T and normalizes the result afterwards. The parameter T is not clamped.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Quaternion</td><td>Starting quaternion. Output when T=0.</td></tr><tr><td>B</td><td>Quaternion</td><td>Ending quaternion. Output when T=1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>Interpolation value.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Interpolated quaternion.</td></tr></tbody></table>

## Quaternion Look Rotation

Creates a rotation with the specified `Forward` and `Upward` directions.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Forward</td><td>Vector3 [editable]</td><td>Vector that represents the forward direction.</td></tr><tr><td>Upward</td><td>Vector3 [editable]</td><td>Vector that represents the upward direction.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation with the specified <code>Forward</code> and <code>Upward</code> directions.</td></tr></tbody></table>

## Quaternion Normalized

Converts this quaternion to a quaternion with the same orientation but with a magnitude of 1.0.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion with any magnitude.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Quaternion with a magnitude of 1.0.</td></tr></tbody></table>

## Quaternion Rotate Towards

Rotates an initial rotation towards a target by a specified number of degrees.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>Quaternion</td><td>The initial rotation.</td></tr><tr><td>To</td><td>Quaternion</td><td>The target rotation.</td></tr><tr><td>Max Delta</td><td>Float [editable]</td><td>The maximum number of degrees to rotate by.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>A rotated version of the <code>From</code> input rotated towards the <code>To</code> input by a maximum of <code>Max Delta</code> degrees.</td></tr></tbody></table>

## Quaternion Set Look Rotation

Creates a rotation with the specified `Forward` and `Upward` directions.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="169">Type</th><th>Description</th></tr></thead><tbody><tr><td>View</td><td>Vector3 [editable]</td><td>Vector that represents the forward direction.</td></tr><tr><td>Up</td><td>Vector3 [editable]</td><td>Vector that represents the upward direction.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation with the specified <code>View</code> and <code>Up</code> directions.</td></tr></tbody></table>

## Quaternion Slerp

Spherically linear interpolates between quaternions `A` and `B`.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Quaternion</td><td>Starting quaternion. Output when T=0.</td></tr><tr><td>B</td><td>Quaternion</td><td>Ending quaternion. Output when T=1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>Interpolation value. Clamped in the range 0 to 1.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Interpolated quaternion.</td></tr></tbody></table>

## Quaternion Slerp Unclamped

Spherically linear interpolates between quaternions `A` and `B`. The parameter T is not clamped.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Quaternion</td><td>Starting quaternion. Output when T=0.</td></tr><tr><td>B</td><td>Quaternion</td><td>Ending quaternion. Output when T=1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>Interpolation value.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Quaternion</td><td>Interpolated quaternion.</td></tr></tbody></table>

## Quaternion To Angle Axis

Converts a rotation to an angle-axis representation.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion</td><td>Quaternion</td><td>Quaternion rotation.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Angle</td><td>Float</td><td>Angle of rotation.</td></tr><tr><td>Axis</td><td>Vector3</td><td>Axis to rotate around.</td></tr></tbody></table>

## Set Quaternion

Set the value of a quaternion component.

**Inputs:**

<table><thead><tr><th width="170">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Enter</td><td>Flow</td><td>Flow to activate the node.</td></tr><tr><td>Quaternion Component</td><td>Quaternion Component</td><td>Reference to the quaternion component for which to set the value.</td></tr><tr><td>Value In</td><td>Quaternion</td><td>Value to assign to the quaternion component.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="167">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Exit</td><td>Flow</td><td>Continue the activating flow.</td></tr><tr><td>Quaternion Out</td><td>Quaternion</td><td>Same as <code>Value In</code>.</td></tr></tbody></table>

## Split Quaternion

Splits a quaternion into its component parts.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>Quaternion In</td><td>Quaternion</td><td>The quaternion to split.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="154">Type</th><th>Description</th></tr></thead><tbody><tr><td>X</td><td>Float</td><td>X component of the quaternion.</td></tr><tr><td>W</td><td>Float</td><td>Y component of the quaternion.</td></tr><tr><td>Z</td><td>Float</td><td>Z component of the quaternion.</td></tr><tr><td>W</td><td>Float</td><td>W component of the quaternion.</td></tr></tbody></table>

after
