Advertisement

Dot product and projection calculator

Use component lists for vectors, or choose a missing value in the magnitude-angle identity.

Calculator

Dot product
3.00000000
Included angle
53.1301
Magnitude of A
5.00000000
Magnitude of B
1.00000000
Projection of A onto B
(3, 0)
Signed scalar projection onto B
3.00000000

Advertisement

How this calculator works

The dot product combines matching components into a scalar. For nonzero vectors, dividing it by their magnitudes gives the cosine of the included angle. Projection keeps only the part of A along B; it is undefined when B is zero, so that output is omitted. The dot product itself remains valid for zero vectors. Missing-component mode recovers the final B component; reorder both vectors together to solve for another position. Magnitude modes reject a right angle, where the equation provides no unique magnitude.

Formula

A dot B = sum(Ai Bi) = |A||B| cos(theta). Projection of A onto B = (A dot B / |B|^2)B.

Worked example

With A = (3, 4) and B = (1, 0), the dot product is 3 and the projection is (3, 0). The included angle is arccos(3/5), about 53.130102 degrees.

Advertisement

Frequently asked questions

Is the result a vector?

The dot product is a scalar. The separate projection result is a vector.

Do perpendicular vectors have zero dot product?

Yes. Conversely, two nonzero vectors with zero dot product are perpendicular.

What units apply?

A dot product has the product of the component units. Projection onto a geometric direction has the same units as A; all components within each vector must be consistent.

Sources

Advertisement