Left operand
Right operand
Target for storing the results (Default: a)
Resulting vector
v1 + ... + vM
Component-wise addition of M n-dimensional vectors. Target is used to store the results.
Array of vectors with length n.
Target for storing the results (Default: vectors[0])
Resulting vector
Clamp all values of a vector
Values to clamp
Minimum value (Default: 0)
Maximum value (Default: 1)
Target for storing the results (Default: a)
Vector with clamped values
Copy the values of one vector to another without creating a new object.
Source vector
Target vector
Target vector as a copy of source
a × b
Find cross product of vectors. Only defined for 3d vectors.
Left operand (3d vector)
Right operand (3d vector)
Target for storing the results (Default: a)
Cross product of vectors
Get the vector going from b to a.
Start coordinates
End coordinates
Target for storing the results (Default: a)
Vector going from a to b
Calculate the distance between two coordinates.
Start coordinates
End coordinates
Distance between coordinates
Calculate the dot product between two vectors.
Left operand
Right operand
Dot product
Fill an array/vector with given value.
Value to fill
Target for storing the results
Filled vector
Flatten a collection of vectors to a single array.
Array of vectors
Single array with all values
Returns true if all elements of a vector is zero, otherwise returns false.
Target vector
Accepted deviation from 0.00 (Default: 0)
Is target zero vector?
Computes the magnitude of a vector.
Target vector
Magnitude of vector
Mix (interpolate) vectors (similar to glsl implementation).
Vector to interpolate from
Vector to interpolate to
Interpolation parameter, 0 = a and 1 = b
Target for storing the results (Default: a)
The interpolated vector
Modify each component of a vector with given function.
Vector to modify
Function used to modify component
Target for storing the results (Default: a)
Vector with modified values
Normalizes a vector
Vector to normalize
Target for storing the results (Default: a)
Normalized vector
Reshapes an array of values to a collection of vectors with given dimensions.
Single array with all values
Dimensions per vector
Array of vectors with given dimensions
Reverses the components of a vector with an performance of O(n/2).
The vector to reverse
Reversed vector
Component-wise scaling of vector.
Vector to scale
Scaling factor
Target for storing the results (Default: a)
Resulting vector
GLSL step for all values of a vector
Edges of the step function
Value used to generate the step function
Target for storing the results (Default: edges)
results for each value in edges
a - b
Component-wise subtraction of two n-dimensional vectors. Target is used to store the results.
Left operand
Right operand
Target for storing the results (Default: a)
Resulting vector
v1 - ... - vM
Component-wise subtraction of M n-dimensional vectors from a. Target is used to store the results.
Vector with length n.
Array of vectors with length n.
Target for storing the results (Default: a)
Resulting vector
Computes the sum of squares
Target vector
Sum of squares
a ∙ b × c
Find triple product between three vectors. Only defined for 3d vectors.
Left operand for dot product (3d vector)
Left operand for cross product (3d vector)
Right operand for cross product (3d vector)
Triple product of vectors
Generated using TypeDoc
a + b
Component-wise addition of two n-dimensional vectors. Target is used to store the results.
add([1, 2], [3, 4], new Array(2)); // Returns: [4, 6]