Vector projection
Find the component of $\mathbf v$ pointing along $\mathbf u$.
Vector projection is one of 5 vectors formulas in the linear algebra section of this library, and it is used at university level.
Why vector projection works
The dot product v · u measures how much of v lines up with u, but that measurement is inflated by the length of u. Dividing by u · u, which is the length of u squared, removes that inflation once for the measurement and once more for the u you multiply back on, leaving a vector that lies along u and stops at v's shadow.
What each symbol means
$\mathbf u$ supplies the projection direction.
Vector projection: when it holds
$\mathbf u\ne\mathbf0$.
When it stops applying
There is no projection onto the zero vector, since u · u would be 0 in the denominator and a single point defines no direction to cast a shadow along. Everything else is fine, including a v that is perpendicular to u, which correctly yields the zero vector.
Vector projection: a worked example
Project $(2,3)$ onto $(1,0)$ to get $(2,0)$.
The mistake to avoid
What people do: Students project onto the wrong vector, computing the shadow of u on v when the question asked for the shadow of v on u.
Why it goes wrong: The two are different vectors, not just different lengths. Projecting (2, 3) onto (1, 0) gives (2, 0), while projecting (1, 0) onto (2, 3) gives about (0.308, 0.462).
Do this instead: Read the subscript as the surface the shadow lands on. In proj with u underneath, the answer always points along u, so your result must be a multiple of u.
Vector projection: step by step
- Name the unknown, and the unit the answer has to come out in.
- Match the symbols to your values. $\mathbf u$ supplies the projection direction.
- Check the conditions before substituting. $\mathbf u\ne\mathbf0$.
- Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most linear algebra slips.
Where this formula fits
- Subject
- Linear Algebra formulas — 17 entries in this library
- Topic
- Vectors
- Level
- University
Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where vector projection comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.
- The Dot Product — the lesson behind this formula: measure alignment and test orthogonality.
- Orthogonal Vector Calculator — check your substitution and the value it produces.
- Study linear algebra — the subject guide that explains the ideas these formulas compress.
- Linear Algebra Practice — questions that make you retrieve the formula instead of recognising it.
- All 17 linear algebra formulas — the full grouped reference, or the complete formula library.
Questions about vector projection
Can the projection point the opposite way from u?
Yes, whenever the dot product is negative. The scalar in front comes out negative and flips the result, which correctly says v leans backwards relative to u.
What is the leftover piece called?
It is the orthogonal component, found as v minus the projection, and it is perpendicular to u. Splitting v into these two parts is the core move behind least squares and Gram-Schmidt.
Why divide by u · u instead of by the magnitude of u?
Because you are correcting for u twice, and u · u is the magnitude squared. If you normalize u first, the formula does simplify to (v · û)û with a single division.
How is this different from the scalar projection?
The scalar projection is just the signed length of the shadow, a plain number equal to (v · u)/‖u‖. This formula multiplies that length back onto a direction, so the answer is an arrow rather than a size.