[**SixL client API**](../../README.md)

***

[SixL client API](../../README.md) / [common](../README.md) / Vector3Constructor

# Interface: Vector3Constructor

The constructor `mp.Vector3`.

## Example

```ts
const pos = new mp.Vector3(100, 200, 30);
```

## Constructors

### Constructor

> **new Vector3Constructor**(`x?`, `y?`, `z?`): [`Vector3`](Vector3.md)

Creates a vector from three numbers.

#### Parameters

##### x?

`number`

East-west, metres (default 0).

##### y?

`number`

North-south, metres (default 0).

##### z?

`number`

Height, metres (default 0).

#### Returns

[`Vector3`](Vector3.md)

#### Example

```ts
const pos = new mp.Vector3(100, 200, 30);
```

### Constructor

> **new Vector3Constructor**(`components`): [`Vector3`](Vector3.md)

Creates a vector from `[x, y, z]`.

#### Parameters

##### components

[`Array3d`](../type-aliases/Array3d.md)

The three components, in metres.

#### Returns

[`Vector3`](Vector3.md)

#### Remarks

A missing element is `undefined`, not 0: pass all three.

#### Example

```ts
const pos = new mp.Vector3([100, 200, 30]);
```

### Constructor

> **new Vector3Constructor**(`components`): [`Vector3`](Vector3.md)

Creates a vector from anything with `x`, `y` and `z`.

#### Parameters

##### components

[`IVector3`](IVector3.md)

A plain object or another vector, in metres.

#### Returns

[`Vector3`](Vector3.md)

#### Remarks

A missing field is `undefined`, not 0: pass all three.

#### Example

```ts
const pos = new mp.Vector3({ x: 100, y: 200, z: 30 });
```
