Options
All
• Public
• Public/Protected
• All

# Class Vector3

• Vector3

• Vec3

## Constructors

### constructor

• new Vector3(x: number, y: number, z: number): Vector3

x: number

y: number

z: number

## Accessors

### Length

• get Length(): number

## Methods

### distance

• distance(v: Vector): number
• The distance between two Vectors.

#### Parameters

• ##### v: Vector

Vector3 to find distance between.

#### Returns number

Distance between this and another vector.

### distanceSquared

• distanceSquared(v: Vector): number
• The product of the Euclidean magnitudes of this and another Vector3.

#### Parameters

• ##### v: Vector

Vector3 to find Euclidean magnitude between.

#### Returns number

Euclidean magnitude with another vector.

### divide

• divide(v: number | Vector): Vector3

### dotProduct

• dotProduct(v: Vector): number

### multiply

• multiply(v: number | Vector): Vector3

### replace

• replace(v: Vector): void

### toArray

• toArray(): [number, number, number]

• add(v1: Vector, v2: number | Vector): Vector3

### Static crossProduct

• crossProduct(v1: Vector, v2: Vector): Vector3

### Static divide

• divide(v1: Vector, v2: number | Vector): Vector3

### Static dotProduct

• dotProduct(v1: Vector, v2: Vector): number

### Static fromArray

• fromArray(primitive: [number, number, number] | number[]): Vector3
• Creates a vector from an array of numbers

example
``````const entityPos = Vector3.fromArray(GetEntityCoords(entity))
``````

#### Parameters

• ##### primitive: [number, number, number] | number[]

An array of numbers (usually returned by a native)

### Static fromArrays

• fromArrays(primitives: [number, number, number][] | number[][]): Vector3[]
• Creates an array of vectors from an array number arrays

example
``````const [forward, right, up, position] = Vector3.fromArrays(GetEntityMatrix(entity))
``````

#### Parameters

• ##### primitives: [number, number, number][] | number[][]

A multi-dimensional array of number arrays

### Static multiply

• multiply(v1: Vector, v2: number | Vector): Vector3

### Static subtract

• subtract(v1: Vector, v2: number | Vector): Vector3

#### Returns Vector3

Generated using TypeDoc