Skip to content

editor / dot

Function: dot() ​

dot(a, b): number

Defined in: math/dot.ts:14

Dot product of two vectors.

Formula: a · b = aₓ bₓ + a_y b_y = |a| |b| cos θ.

Parameters ​

a ​

Vector

first vector

b ​

Vector

second vector

Returns ​

number

the scalar product, zero for perpendicular vectors

Kind ​

math

See ​

REF-MATHWORLD-DOT