Math

Dot Product & Angle

The dot product combines two vectors into a single number. Its sign tells whether the vectors point together, apart, or at a right angle.

5 minLevel 1/3The interactive stage stays ad-free.
u · v0.364Angle85.0°|u|2.20|v|1.90Signed proj.0.19

u · v = (1.99)(-0.65) + (0.93)(1.79) = 0.364

Acute: the vectors point partly in the same direction.

The dot product measures alignment. Its sign tells you whether the angle is acute, right, or obtuse. The cyan arrow is the projection of u onto v; the rose segment shows the perpendicular residual.

What you are seeing

1

In coordinates, u · v = u₁v₁ + u₂v₂. Multiply matching components and add.

2

The identity u · v = |u||v| cos θ connects the product to the angle between the vectors.

3

The projection length of u onto v is (u · v) / |v|. A zero dot product means the vectors are perpendicular.

Why it matters

Dot products power projection, least squares, lighting in graphics, similarity search, and the definition of orthogonality.

Complexity & details

For two vectors, the dot product, lengths, and angle all take O(1) time in 2D.

Frequently asked questions

Why does a zero dot product mean perpendicular?+

Because u · v = |u||v| cos θ. If neither vector has zero length, the product is zero exactly when cos θ = 0, which means θ = 90°.

What does a negative dot product mean?+

The angle is obtuse: the vectors point partly in opposite directions. A positive dot product means an acute angle.