vector.dot

Edit

Returns the dot product of two vectors.

dot = vector.dot(a, b)

Arguments

NameTypeDescription
avector The first vector.
bvector The second vector.

Returns

NameTypeDescription
dotnumber The dot product of the two vectors.

Notes

This is computed as a.x * b.x + a.y * b.y + a.z * b.z.

Example

vector.dot(vector(1, 2, 3), vector(3, 2, 1)) --> 10

See also