Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Project One Vector onto Another

The projection of u\mathbf{u} onto v\mathbf{v} is the shadow of u\mathbf{u} on the line through v\mathbf{v}. It is a multiple of v\mathbf{v}, and the multiplier is u⋅v\mathbf{u} \cdot \mathbf{v} divided by v⋅v\mathbf{v} \cdot \mathbf{v}.

Recognize the task

Wording like "projection of u\mathbf{u} onto v\mathbf{v}", "component of u\mathbf{u} along v\mathbf{v}", "split u\mathbf{u} into parallel and perpendicular parts": proj⁡vu\operatorname{proj}_{\mathbf{v}}\mathbf{u}, the work done by a force along a ramp. Test: which vector is the direction you project onto?
Projection is defined in the orthogonal projection lesson section; projecting onto a whole subspace is orthogonal projection.

Two ways to do it

Vector projectiona vector
proj⁡vu=u⋅vv⋅v v\operatorname{proj}_{\mathbf{v}}\mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{\mathbf{v} \cdot \mathbf{v}}\,\mathbf{v}
The vector projection formula: no square roots needed.
Scalar projectiona signed length
comp⁡vu=u⋅v∥v∥\operatorname{comp}_{\mathbf{v}}\mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|}
The scalar projection: use it when the question asks "how far along", not for the vector itself.

Steps

StepOn u=(2,3,4)\mathbf{u} = (2, 3, 4) onto v=(1,0,1)\mathbf{v} = (1, 0, 1)
1Identify the vector you project onto. The answer is a multiple of that vector. Swapping the roles gives a different answer.project onto v=(1,0,1)\mathbf{v} = (1, 0, 1)
2Compute the dot product u · v. See the dot product.u⋅v=2+0+4=6\mathbf{u} \cdot \mathbf{v} = 2 + 0 + 4 = 6
3Compute v · v. This is ∥v∥2\|\mathbf{v}\|^2, the squared length.v⋅v=1+0+1=2\mathbf{v} \cdot \mathbf{v} = 1 + 0 + 1 = 2
4Divide and scale v. The ratio is the multiplier of v\mathbf{v}.Scalar multiplication ↗62 (1,0,1)=(3,0,3)\tfrac{6}{2}\,(1, 0, 1) = (3, 0, 3)
5Check: the leftover is perpendicular to v. Subtract the projection from u\mathbf{u}; the result must have dot product 00 with v\mathbf{v} (the orthogonal decomposition).Component-wise addition ↗(2,3,4)−(3,0,3)=(−1,3,1)(2, 3, 4) - (3, 0, 3) = (-1, 3, 1);  −1+0+1=0\ -1 + 0 + 1 = 0 ✓

Worked examples

Example 1 · onto a coordinate axis

basic
u=(5,−2)\mathbf{u} = (5, -2) onto v=(1,0)\mathbf{v} = (1, 0)
51 (1,0)=(5,0)\dfrac{5}{1}\,(1, 0) = (5, 0)
keeps the first component

Example 2 · fractional multiplier

vector and scalar
(3,4)⋅(1,2)=11(3, 4) \cdot (1, 2) = 11,  (1,2)⋅(1,2)=5\ (1, 2) \cdot (1, 2) = 5
proj⁡=115(1,2)=(115,225)\operatorname{proj} = \tfrac{11}{5}(1, 2) = \left(\tfrac{11}{5}, \tfrac{22}{5}\right)
vector projection
comp⁡=115≈4.92\operatorname{comp} = \dfrac{11}{\sqrt{5}} \approx 4.92
its signed length

Example 3 · parallel and perpendicular parts

decomposition
u=(1,2,3)\mathbf{u} = (1, 2, 3), v=(1,1,1)\mathbf{v} = (1, 1, 1):  63 v=(2,2,2)\ \tfrac{6}{3}\,\mathbf{v} = (2, 2, 2)
parallel part
(1,2,3)−(2,2,2)=(−1,0,1)(1, 2, 3) - (2, 2, 2) = (-1, 0, 1)
perpendicular part
u=(2,2,2)+(−1,0,1)\mathbf{u} = (2, 2, 2) + (-1, 0, 1)
check: −1+0+1=0-1 + 0 + 1 = 0
Drag both vectors in the vector projection visualizer.

See it happen

Shine a light straight down onto the line through v\mathbf{v}: the shadow of u\mathbf{u} is the projection. The leftover piece, from the shadow's tip up to the tip of u\mathbf{u}, meets the line at a right angle. That right angle is the whole method: it forces the multiplier to be u⋅v/v⋅v\mathbf{u} \cdot \mathbf{v} / \mathbf{v} \cdot \mathbf{v}.

Common mistakes

Dividing by the length instead of the squared length

✗ proj⁡vu=u⋅v∥v∥ v\operatorname{proj}_{\mathbf{v}}\mathbf{u} = \dfrac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|}\,\mathbf{v}
✓ divide by v⋅v=∥v∥2\mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^2, or use the unit vector twice

Projecting the wrong way round

✗ proj⁡vu=u⋅vu⋅u u\operatorname{proj}_{\mathbf{v}}\mathbf{u} = \dfrac{\mathbf{u} \cdot \mathbf{v}}{\mathbf{u} \cdot \mathbf{u}}\,\mathbf{u}
✓ that is proj⁡uv\operatorname{proj}_{\mathbf{u}}\mathbf{v}; the answer must be a multiple of v\mathbf{v}

Giving a number when a vector is asked

✗ projection of (3,4)(3, 4) onto (1,2)(1, 2) is 115\tfrac{11}{5}
✓ 115\tfrac{11}{5} is the multiplier; the projection is (115,225)\left(\tfrac{11}{5}, \tfrac{22}{5}\right)