Scalar Projection of One Vector onto Another

compba=abb\text{comp}_{\vec{b}}\vec{a} = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|}

Enter your known values, leave one input blank, and solves for the missing one. Try different units for next level excitement!

Learning zone

Shine a light perpendicular to b and the shadow that a casts along it has length (a·b)/|b| — equivalently |a| cos θ. This is how a diagonal quantity gets charged to a chosen direction: the component of a ship's velocity along the intended course, the part of a rope's tension that actually lifts, the useful fraction of an angled push. A dot product of 24 against a vector b of length 6 means a reaches 4 units along b's direction, regardless of how long a itself is or how far it strays sideways.

The trap sits in the denominator. It is |b|, the vector being projected onto, never |a|. Dividing by the wrong magnitude quietly returns the cosine of the angle scaled by the wrong length, and the mistake survives dimensional analysis, so it will not announce itself. A negative result is perfectly legitimate and means a leans backwards along b — its shadow falls on the far side of the origin.

Scalar Projection of One Vector onto Another
compba=abb\text{comp}_{\vec{b}}\vec{a} = \frac{\vec{a}\cdot\vec{b}}{|\vec{b}|}
Where
  • compba\text{comp}_{\vec{b}}\vec{a}= Scalar projection of a onto b
  • ab\vec{a}\cdot\vec{b}= Dot product of a and b
  • b|\vec{b}|= Magnitude of b
Missing one of these? Work it out first, then come back