Options
All
• Public
• Public/Protected
• All

# Namespace vec3

## Functions

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### angle

• Get the angle between two 3D vectors

#### Parameters

The first operand

The second operand

### bezier

• Performs a bezier interpolation with two control points

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

the third operand

the fourth operand

• ##### t: number

interpolation amount, in the range [0-1], between the two inputs

out

### ceil

• ceil(out: vec3, a: ReadonlyVec3): vec3
• Math.ceil the components of a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to ceil

out

### clone

• Creates a new vec3 initialized with values from an existing vector

#### Parameters

vector to clone

#### Returns vec3

a new 3D vector

### copy

• copy(out: vec3, a: ReadonlyVec3): vec3
• Copy the values from one vec3 to another

#### Parameters

• ##### out: vec3

the receiving vector

the source vector

out

### create

• Creates a new, empty vec3

#### Returns vec3

a new 3D vector

### cross

• Computes the cross product of two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### dist

• Calculates the euclidian distance between two vec3's

#### Parameters

the first operand

the second operand

#### Returns number

distance between a and b

### distance

• Calculates the euclidian distance between two vec3's

#### Parameters

the first operand

the second operand

#### Returns number

distance between a and b

### div

• Divides two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### divide

• Divides two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### dot

• Calculates the dot product of two vec3's

#### Parameters

the first operand

the second operand

#### Returns number

dot product of a and b

### equals

• Returns whether or not the vectors have approximately the same elements in the same position.

#### Parameters

The first vector.

The second vector.

#### Returns boolean

True if the vectors are equal, false otherwise.

### exactEquals

• Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

#### Parameters

The first vector.

The second vector.

#### Returns boolean

True if the vectors are equal, false otherwise.

### floor

• floor(out: vec3, a: ReadonlyVec3): vec3
• Math.floor the components of a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to floor

out

### forEach

• forEach(a: any, stride: any, offset: any, count: any, fn: any, arg: any): any

### fromValues

• fromValues(x: number, y: number, z: number): vec3
• Creates a new vec3 initialized with the given values

#### Parameters

• ##### x: number

X component

• ##### y: number

Y component

• ##### z: number

Z component

#### Returns vec3

a new 3D vector

### hermite

• Performs a hermite interpolation with two control points

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

the third operand

the fourth operand

• ##### t: number

interpolation amount, in the range [0-1], between the two inputs

out

### inverse

• inverse(out: vec3, a: ReadonlyVec3): vec3
• Returns the inverse of the components of a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to invert

out

### len

• Calculates the length of a vec3

#### Parameters

vector to calculate length of

length of a

### length

• Calculates the length of a vec3

#### Parameters

vector to calculate length of

length of a

### lerp

• Performs a linear interpolation between two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

• ##### t: number

interpolation amount, in the range [0-1], between the two inputs

out

### max

• Returns the maximum of two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### min

• Returns the minimum of two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### mul

• Multiplies two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### multiply

• Multiplies two vec3's

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### negate

• negate(out: vec3, a: ReadonlyVec3): vec3
• Negates the components of a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to negate

out

### normalize

• normalize(out: vec3, a: ReadonlyVec3): vec3
• Normalize a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to normalize

out

### random

• random(out: vec3, scale?: number): vec3
• Generates a random vector with the given scale

#### Parameters

• ##### out: vec3

the receiving vector

out

### rotateX

• Rotate a 3D vector around the x-axis

#### Parameters

• ##### out: vec3

The receiving vec3

The vec3 point to rotate

The origin of the rotation

The angle of rotation in radians

out

### rotateY

• Rotate a 3D vector around the y-axis

#### Parameters

• ##### out: vec3

The receiving vec3

The vec3 point to rotate

The origin of the rotation

The angle of rotation in radians

out

### rotateZ

• Rotate a 3D vector around the z-axis

#### Parameters

• ##### out: vec3

The receiving vec3

The vec3 point to rotate

The origin of the rotation

The angle of rotation in radians

out

### round

• round(out: vec3, a: ReadonlyVec3): vec3
• Math.round the components of a vec3

#### Parameters

• ##### out: vec3

the receiving vector

vector to round

out

### scale

• scale(out: vec3, a: ReadonlyVec3, b: number): vec3
• Scales a vec3 by a scalar number

#### Parameters

• ##### out: vec3

the receiving vector

the vector to scale

• ##### b: number

amount to scale the vector by

#### Returns vec3

out

• Adds two vec3's after scaling the second operand by a scalar value

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

• ##### scale: number

the amount to scale b by before adding

out

### set

• set(out: vec3, x: number, y: number, z: number): vec3
• Set the components of a vec3 to the given values

#### Parameters

• ##### out: vec3

the receiving vector

• ##### x: number

X component

• ##### y: number

Y component

• ##### z: number

Z component

out

### sqrDist

• Calculates the squared euclidian distance between two vec3's

#### Parameters

the first operand

the second operand

#### Returns number

squared distance between a and b

### sqrLen

• Calculates the squared length of a vec3

#### Parameters

vector to calculate squared length of

#### Returns number

squared length of a

### squaredDistance

• Calculates the squared euclidian distance between two vec3's

#### Parameters

the first operand

the second operand

#### Returns number

squared distance between a and b

### squaredLength

• Calculates the squared length of a vec3

#### Parameters

vector to calculate squared length of

#### Returns number

squared length of a

### str

• Returns a string representation of a vector

#### Parameters

vector to represent as a string

#### Returns string

string representation of the vector

### sub

• Subtracts vector b from vector a

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### subtract

• Subtracts vector b from vector a

#### Parameters

• ##### out: vec3

the receiving vector

the first operand

the second operand

out

### transformMat3

• Transforms the vec3 with a mat3.

#### Parameters

• ##### out: vec3

the receiving vector

the vector to transform

the 3x3 matrix to transform with

out

### transformMat4

• Transforms the vec3 with a mat4. 4th vector component is implicitly '1'

#### Parameters

• ##### out: vec3

the receiving vector

the vector to transform

matrix to transform with

out

### transformQuat

• Transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)

#### Parameters

• ##### out: vec3

the receiving vector

the vector to transform

quaternion to transform with

out

### zero

• Set the components of a vec3 to zero

#### Parameters

• ##### out: vec3

the receiving vector

out