The first vector to calculate the dot product.
The second vector to calculate the dot product.
A number representing the dot product of the two vectors.
If the vectors' lengths do not match.
dot([1, 3, -5], [4, -2, -1]); // Returns 3
Calculates the dot product of two vectors of bigints.
The function is an algebraic operation that takes two equal-length sequences of bigints (usually coordinate vectors) and returns a single bigint.
The first vector to calculate the dot product.
The second vector to calculate the dot product.
A bigint representing the dot product of the two vectors.
If the vectors' lengths do not match.
dot([1n, 3n, -5n], [4n, -2n, -1n]); // Returns 3n
Calculates the dot product of two vectors of a generic type.
The function is an algebraic operation that takes two equal-length sequences of generic type (usually coordinate vectors) and returns a single value of type T.
The numeric type of the elements in the vector. T is inferred and doesn't need to be supplied manually.
The first vector to calculate the dot product.
The second vector to calculate the dot product.
(optional) An instance of Numerical interface for the numeric type T.
A value of type T, representing the dot product of two vectors.
If the vectors' type is neither array of numbers nor bigints, and no Numerical
If the vectors' lengths do not match.
dot([1, 3, -5], [4, -2, -1], new Numerical()); // Where Numerical() is an implementation for type T.
Generated using TypeDoc
Calculates the dot product of two vectors of numbers.
The function is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number.