How to project one vector onto another
4 min read
Short answer
The projection of onto is the vector along that is closest to : What is left over, , is perpendicular to .
Where the formula comes from
You want the multiple so that the leftover is perpendicular to . Perpendicular means the dot product is 0: , so and .
Scalar projection and uses
The length (with sign) of the shadow of on is . Projection is the building block of Gram-Schmidt, least squares and the work done by a force along a direction.
Worked example
Project onto .
and , so and Check: the leftover is , and , so it is perpendicular. ✓
Try it yourself
Project onto .
Show the answer
and , so the projection is .
Keep going with practice
Vidi's vector playground lets you drag two vectors and watch the projection and the perpendicular leftover update live.