Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Linear Algebra formulas

Vector projection

Find the component of $\mathbf v$ pointing along $\mathbf u$.

Linear Algebra · Vectors
$$\operatorname{proj}_{\mathbf u}\mathbf v=\frac{\mathbf v\cdot\mathbf u}{\mathbf u\cdot\mathbf u}\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

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $\mathbf u$ supplies the projection direction.
  3. Check the conditions before substituting. $\mathbf u\ne\mathbf0$.
  4. 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.

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.

Stuck on a problem?

Work a vector projection problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.