# sm.quat.new

Creates a new quaternion.

**Kind:** Function

**Environments:** Game, Terrain

## Game

### Game overload 1

``` { .lua .api-signature }
sm.quat.new( quaternion )
```

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

**Parameters:**

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

**Returns:**

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

### Game overload 2

``` { .lua .api-signature }
sm.quat.new( x, y, z, w )
```

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

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `x` | number | The X value. |
| `y` | number | The Y value. |
| `z` | number | The Z value. |
| `w` | number | The W value. |

**Returns:**

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

## Terrain

### Terrain overload 1

``` { .lua .api-signature }
sm.quat.new( quaternion )
```

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

**Parameters:**

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

**Returns:**

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

### Terrain overload 2

``` { .lua .api-signature }
sm.quat.new( x, y, z, w )
```

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

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `x` | number | The X value. |
| `y` | number | The Y value. |
| `z` | number | The Z value. |
| `w` | number | The W value. |

**Returns:**

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