Recipe
Find the orthogonal projection of one vector onto another
Use when: you have a nonzero vector u and any vector v, and need the piece of v that lies exactly along u's own direction
Goal: the projection vector \operatorname{proj}_u v, and if asked, confirmation that the leftover residual is perpendicular to u
Taught in Orthogonal projection, revisited
Quick recipe
-
1
Multiply matching components of v and u and add them for v\cdot u; do the same with u against itself for u\cdot u.
Example
For u=(2,-1) and v=(3,4): v\cdot u = (3)(2)+(4)(-1) = 2, and u\cdot u = 2^2+(-1)^2=5.
- u is the nonzero vector being projected onto — continue normally; u\cdot u is guaranteed positive.
- u is the zero vector — the projection is undefined, since there's no direction to measure "along."
Why: the projection formula divides by u\cdot u, so it only makes sense once u genuinely points somewhere.
-
2
Divide v\cdot u by u\cdot u. That single number says how many multiples of u the shadow reaches.
Example
\dfrac{v\cdot u}{u\cdot u} = \dfrac{2}{5}.
Why: this ratio is exactly the coefficient the Orthogonal Decomposition Theorem needs to build the closest point on u's line.
-
3
Scale u by the fraction from Step 2, one component at a time.
Example
\operatorname{proj}_u v = \frac25(2,-1) = \left(\frac45,-\frac25\right).
⚡ Shortcut
If v is already a scalar multiple of u, skip the arithmetic: \operatorname{proj}_u v = v itself, since the whole vector already lies on u's line. If v is already perpendicular to u (so v\cdot u=0), skip straight to \operatorname{proj}_u v = \mathbf 0, since there's no shadow to cast at all.
Why: the projection is required to lie on u's line, meaning it must be some scalar multiple of u; Step 2 found exactly which multiple.
-
4
Subtract the projection from v to get the residual w=v-\operatorname{proj}_uv, then dot w specifically with u and confirm it comes out to 0.
Example
w = \left(3-\frac45,\ 4+\frac25\right) = \left(\frac{11}{5},\frac{22}{5}\right), and w\cdot u = \left(\frac{11}{5}\right)(2)+\left(\frac{22}{5}\right)(-1) = \frac{22}{5}-\frac{22}{5}=0.
- w\cdot u = 0 — the projection is verified correct.
- w\cdot u \ne 0 — an arithmetic error happened upstream; redo Steps 1 through 3.
Why: perpendicularity to u specifically, not to v, is the defining property that makes this the closest point on u's line to v.
Common mistakes
- Dotting the residual against v instead of against u when checking perpendicularity.
- Writing \lVert u\rVert where the formula actually needs u\cdot u, which is \lVert u\rVert^2.
- Assuming v itself must be perpendicular to u whenever a projection is asked for.
- Trying to project onto the zero vector without checking u is nonzero first.