# sm.quat.slerp

Performs a spherical linear interpolation between two quaternion.

**Kind:** Function

**Environments:** Game, Terrain

## Game

``` { .lua .api-signature }
sm.quat.slerp( quaternion1, quaternion2, t )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.quat.md#slerp)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `quaternion1` | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The first quaternion. |
| `quaternion2` | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The second quaternion. |
| `t` | number | Interpolation amount between the two inputs. |

**Returns:**

| Type | Description |
| --- | --- |
| [Quat](../Game-Script-Environment/Userdata/Quat.md) | The interpolated quaternion. |

## Terrain

``` { .lua .api-signature }
sm.quat.slerp( quaternion1, quaternion2, t )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.quat.md#slerp)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `quaternion1` | [Quat](../Terrain-Script-Environment/Userdata/Quat.md) | The first quaternion. |
| `quaternion2` | [Quat](../Terrain-Script-Environment/Userdata/Quat.md) | The second quaternion. |
| `t` | number | Interpolation amount between the two inputs. |

**Returns:**

| Type | Description |
| --- | --- |
| [Quat](../Terrain-Script-Environment/Userdata/Quat.md) | The interpolated quaternion. |
