Mathwords logoMathwords

Vector Space Projection — Definition, Formula & Examples

A vector space projection is the operation of mapping a vector onto a subspace (such as a line or plane) so that the difference between the original vector and its image is orthogonal to that subspace. The result is the component of the vector that lies entirely within the subspace.

Given a subspace WW of an inner product space VV and a vector vV\mathbf{v} \in V, the orthogonal projection of v\mathbf{v} onto WW is the unique vector projWvW\text{proj}_W \mathbf{v} \in W such that vprojWv\mathbf{v} - \text{proj}_W \mathbf{v} is orthogonal to every vector in WW. When W=span(u)W = \text{span}(\mathbf{u}), this reduces to projection onto a single vector.

Key Formula

projuv=vuuuu\text{proj}_{\mathbf{u}}\, \mathbf{v} = \frac{\mathbf{v} \cdot \mathbf{u}}{\mathbf{u} \cdot \mathbf{u}}\, \mathbf{u}
Where:
  • v\mathbf{v} = The vector being projected
  • u\mathbf{u} = The vector (or direction) onto which you project
  • vu\mathbf{v} \cdot \mathbf{u} = The dot product of v and u

How It Works

To project a vector v\mathbf{v} onto a vector u\mathbf{u}, you compute the scalar ratio of their dot product to the dot product of u\mathbf{u} with itself, then scale u\mathbf{u} by that ratio. The resulting vector points in the direction of u\mathbf{u} and represents how much of v\mathbf{v} lies along u\mathbf{u}. The leftover part, vprojuv\mathbf{v} - \text{proj}_{\mathbf{u}} \mathbf{v}, is perpendicular to u\mathbf{u}. For projection onto a higher-dimensional subspace with basis columns in a matrix AA, you use the projection matrix P=A(ATA)1ATP = A(A^T A)^{-1} A^T.

Worked Example

Problem: Project the vector v = (3, 4) onto the vector u = (1, 0).
Compute the dot products: Find v · u and u · u.
vu=3(1)+4(0)=3,uu=1(1)+0(0)=1\mathbf{v} \cdot \mathbf{u} = 3(1) + 4(0) = 3, \quad \mathbf{u} \cdot \mathbf{u} = 1(1) + 0(0) = 1
Apply the formula: Multiply u by the scalar ratio.
projuv=31(1,0)=(3,0)\text{proj}_{\mathbf{u}}\, \mathbf{v} = \frac{3}{1}(1, 0) = (3, 0)
Verify orthogonality: The residual v − proj should be perpendicular to u.
(3,4)(3,0)=(0,4),(0,4)(1,0)=0  (3,4) - (3,0) = (0,4), \quad (0,4) \cdot (1,0) = 0 \; \checkmark
Answer: The projection of (3, 4) onto (1, 0) is (3, 0).

Why It Matters

Projection is the engine behind least-squares regression: when a system Ax=bA\mathbf{x} = \mathbf{b} has no exact solution, you project b\mathbf{b} onto the column space of AA to find the best approximate solution. It also appears in computer graphics for lighting calculations and in signal processing for decomposing signals into orthogonal components.

Common Mistakes

Mistake: Dividing by v · v instead of u · u in the denominator.
Correction: The denominator must be the dot product of the vector you are projecting onto with itself (u · u), not the vector being projected.