> 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/vector-3/vector3-math.md).

# Vector3 Math

## Vector3 Angle

Calculates the angle between two vectors.

**Inputs:**

<table><thead><tr><th width="155">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>Vector3 [editable]</td><td>First vector.</td></tr><tr><td>To</td><td>Vector3 [editable]</td><td>Second vector.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>The smallest angle between the two vectors.</td></tr></tbody></table>

## Vector3 Clamp Magnitude

Scales the input vector to the specified magnitude.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Vector</td><td>Vector3 [editable]</td><td>The input vector.</td></tr><tr><td>Maxlength</td><td>Float [editable]</td><td>The target magnitude for the output vector.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>Version of the input vector scaled so that its magnitude is equal to or less than <code>Maxlength</code>.</td></tr></tbody></table>

## Vector3 Cross

Calculates the cross product of two input vectors.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Lhs</td><td>Vector3 [editable]</td><td>First vector.</td></tr><tr><td>Rhs</td><td>Vector3 [editable]</td><td>Second vector.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>Vector which is perpendicular to the two input vectors</td></tr></tbody></table>

## Vector3 Distance

Calculates the distance between two points in 3D space.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Vector3 [editable]</td><td>First point in 3D space.</td></tr><tr><td>B</td><td>Vector3 [editable]</td><td>Second point in 3D space.</td></tr></tbody></table>

**Outputs:**

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

## Vector3 Dot

Calculates the dot product of two input vectors.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Lhs</td><td>Vector3 [editable]</td><td>First vector.</td></tr><tr><td>Rhs</td><td>Vector3 [editable]</td><td>Second vector.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>Dot product of the two input vectors.</td></tr></tbody></table>

## Vector3 Lerp

Linearly interpolates between two points.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Vector3 [editable]</td><td>Start value, returned when T = 0.</td></tr><tr><td>B</td><td>Vector3 [editable]</td><td>End value, returned when T = 1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>The interpolation value.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>The interpolated vector.</td></tr></tbody></table>

## Vector3 Magnitude

Calculates the length of a given vector.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Vector3 [editable]</td><td>The vector to evaluate.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>The length of the vector.</td></tr></tbody></table>

## Vector3 Move Towards

Calculates a point between a current vector and a target vector, advancing towards the target by a specified maximum distance.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Current</td><td>Vector3 [editable]</td><td>The starting point.</td></tr><tr><td>Target</td><td>Vector3 [editable]</td><td>The target point.</td></tr><tr><td>Max Distance</td><td>Float [editable]</td><td>The maximum distance to move towards the target.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>A point that has advanced <code>Max Distance</code> towards <code>Target</code>, having started at <code>Current</code>.</td></tr></tbody></table>

## Vector3 Normalize

Scales the vector to have a magnitude of 1.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Vector3 [editable]</td><td>Input vector.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>The scaled vector with a magnitude of 1.</td></tr></tbody></table>

## Vector3 Signed Angle

Calculates the signed angle between two vectors in relation to a given axis.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>From</td><td>Vector3 [editable]</td><td>The vector from which the angular difference is measured.</td></tr><tr><td>To</td><td>Vector3 [editable]</td><td>The vector to which the angular difference is measured.</td></tr><tr><td>Axis</td><td>Vector3 [editable]</td><td>A vector around which the other vectors are rotated.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>The signed angle between <code>From</code> and <code>To</code> in degrees.</td></tr></tbody></table>

## Vector3 Slerp

Spherically interpolates between two vectors.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>A</td><td>Vector3 [editable]</td><td>Start value, returned when T = 0.</td></tr><tr><td>B</td><td>Vector3 [editable]</td><td>End value, returned when T = 1.</td></tr><tr><td>T</td><td>Float [editable]</td><td>The interpolation value.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Vector3</td><td>The interpolated Vector3.</td></tr></tbody></table>

## Vector3 Smooth Damp

Gradually changes a vector towards a desired goal over time.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Current</td><td>Vector3 [editable]</td><td>The current value.</td></tr><tr><td>Target</td><td>Vector3 [editable]</td><td>The target value.</td></tr><tr><td>Smooth Time</td><td>Float [editable]</td><td>The approximate time over which to move from <code>Current</code> to <code>Target</code>.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Current Velocity</td><td>Vector3</td><td>The current rate of change.</td></tr><tr><td>Output</td><td>Vector3</td><td>The adjusted <code>Current</code> input.</td></tr></tbody></table>

## Vector3 Sqr Magnitude

Returns the squared length of this vector.

**Inputs:**

<table><thead><tr><th width="154">Name</th><th width="165">Type</th><th>Description</th></tr></thead><tbody><tr><td>Input</td><td>Vector3 [editable]</td><td>The vector to evaluate.</td></tr></tbody></table>

**Outputs:**

<table><thead><tr><th width="154">Name</th><th width="166">Type</th><th>Description</th></tr></thead><tbody><tr><td>Output</td><td>Float</td><td>The squared length of this vector.</td></tr></tbody></table>
