Skip to content

Orthogonal Projection


Definition

Let WW be a subspace of Rn\mathbb{R}^n (or of a finite-dimensional inner product space VV). Every b\boldsymbol{b} can be written uniquely as

b=p+e,p∈W,e∈W⊥,\boldsymbol{b}=\boldsymbol{p}+\boldsymbol{e},\qquad \boldsymbol{p}\in W,\quad \boldsymbol{e}\in W^\perp,

where W⊥W^\perp is the orthogonal complement of WW. The vector p=proj⁡Wb\boldsymbol{p}=\operatorname{proj}_W\boldsymbol{b} is the orthogonal projection of b\boldsymbol{b} onto WW, and e=b−p\boldsymbol{e}=\boldsymbol{b}-\boldsymbol{p} is the error. The map b↦proj⁡Wb\boldsymbol{b}\mapsto\operatorname{proj}_W\boldsymbol{b} is a linear map; its matrix PP is the orthogonal projection matrix onto WW.


Interpretation

Drop a perpendicular from b\boldsymbol{b} to WW: its foot is p\boldsymbol{p}. The error is orthogonal to every vector of WW, not just to p\boldsymbol{p}; checking e⊥p\boldsymbol{e}\perp\boldsymbol{p} alone is not enough.

A plane W through the origin with a vector b above it, its projection p in W, the error e = b - p perpendicular to W, and another point w of W forming a right triangle with b and p.

In the figure, e\boldsymbol{e} stands perpendicular to the whole plane WW, not only to p\boldsymbol{p}. For any other w∈W\boldsymbol{w}\in W the points b\boldsymbol{b}, p\boldsymbol{p}, w\boldsymbol{w} form a right triangle with the right angle at p\boldsymbol{p}, so the hypotenuse ∥b−w∥\|\boldsymbol{b}-\boldsymbol{w}\| is longer than ∥e∥\|\boldsymbol{e}\|. Pythagoras makes this exact: ∥b−w∥2=∥e∥2+∥p−w∥2\|\boldsymbol{b}-\boldsymbol{w}\|^2=\|\boldsymbol{e}\|^2+\|\boldsymbol{p}-\boldsymbol{w}\|^2. So orthogonality is what makes p\boldsymbol{p} the closest point of WW to b\boldsymbol{b} in the Euclidean norm; this best-approximation property is the basis of least squares.

Move the entries of b\boldsymbol{b} and switch between a line and a plane WW: the error e=b−p\boldsymbol{e}=\boldsymbol{b}-\boldsymbol{p} stays perpendicular to WW. Switch on the comparison to see that every other w∈W\boldsymbol{w}\in W lies farther from b\boldsymbol{b} than p\boldsymbol{p}.


Key Results

  • Best approximation: ∥b−proj⁡Wb∥<∥b−w∥\|\boldsymbol{b}-\operatorname{proj}_W\boldsymbol{b}\|<\|\boldsymbol{b}-\boldsymbol{w}\| for every w∈W\boldsymbol{w}\in W with w≠proj⁡Wb\boldsymbol{w}\neq\operatorname{proj}_W\boldsymbol{b}.
  • Onto a line spanned by a≠0\boldsymbol{a}\neq\boldsymbol{0}: p=a⊤ba⊤a a\boldsymbol{p}=\dfrac{\boldsymbol{a}^{\top}\boldsymbol{b}}{\boldsymbol{a}^{\top}\boldsymbol{a}}\,\boldsymbol{a} and P=aa⊤a⊤aP=\dfrac{\boldsymbol{a}\boldsymbol{a}^{\top}}{\boldsymbol{a}^{\top}\boldsymbol{a}}.
  • With an orthonormal basis q1,…,qk\boldsymbol{q}_1,\ldots,\boldsymbol{q}_k of WW as columns of QQ: p=∑i(qi⊤b)qi\displaystyle \boldsymbol{p}=\sum_i(\boldsymbol{q}_i^{\top}\boldsymbol{b})\boldsymbol{q}_i and P=QQ⊤P=QQ^{\top}.
  • If W=Col⁡(A)W=\operatorname{Col}(A), the column space of an n×kn\times k matrix AA of full column rank: P=A(A⊤A)−1A⊤P=A(A^{\top}A)^{-1}A^{\top}.
  • A square matrix PP is an orthogonal projection matrix if and only if P2=PP^2=P and P⊤=PP^{\top}=P; it then projects onto its column space.
  • Every orthogonal projection matrix is idempotent, but oblique projections are idempotent without being symmetric, so not every idempotent matrix is an orthogonal projection.
  • I−PI-P is the orthogonal projection onto W⊥W^\perp, and ∥Pb∥≤∥b∥\|P\boldsymbol{b}\|\le\|\boldsymbol{b}\|.
  • The eigenvalues of PP lie in {0,1}\{0,1\}, and rank⁡P=tr⁡P=dim⁡W\operatorname{rank}P=\operatorname{tr}P=\dim W (trace).

Examples

Onto a line. Project b=(1,2,3)⊤\boldsymbol{b}=(1,2,3)^{\top} onto the line spanned by a=(1,1,1)⊤\boldsymbol{a}=(1,1,1)^{\top}: a⊤b=6\boldsymbol{a}^{\top}\boldsymbol{b}=6 and a⊤a=3\boldsymbol{a}^{\top}\boldsymbol{a}=3, so p=(2,2,2)⊤\boldsymbol{p}=(2,2,2)^{\top} and e=(−1,0,1)⊤\boldsymbol{e}=(-1,0,1)^{\top}. Check a⊤e=0\boldsymbol{a}^{\top}\boldsymbol{e}=0. The distance from b\boldsymbol{b} to the line is ∥e∥=2\|\boldsymbol{e}\|=\sqrt{2}.

Onto a plane. Let W=Col⁡(A)W=\operatorname{Col}(A) with A=(100110)A=\begin{pmatrix}1&0\\0&1\\1&0\end{pmatrix} and b=(1,2,5)⊤\boldsymbol{b}=(1,2,5)^{\top}. Then A⊤A=diag⁡(2,1)A^{\top}A=\operatorname{diag}(2,1), A⊤b=(6,2)⊤A^{\top}\boldsymbol{b}=(6,2)^{\top}, so the coefficients are (3,2)⊤(3,2)^{\top} and

p=(3,2,3)⊤,e=(−2,0,2)⊤,P=(1201201012012).\boldsymbol{p}=(3,2,3)^{\top},\qquad \boldsymbol{e}=(-2,0,2)^{\top},\qquad P=\begin{pmatrix}\tfrac{1}{2}&0&\tfrac{1}{2}\\0&1&0\\\tfrac{1}{2}&0&\tfrac{1}{2}\end{pmatrix}.

The error is orthogonal to both columns, PP is symmetric with P2=PP^2=P, and tr⁡P=2=dim⁡W\operatorname{tr}P=2=\dim W.


Prerequisites



Sources

Aliases: orthogonal projector, projection onto a subspace, perpendicular projection Keywords: proj_W b, P = A(A^T A)^{-1} A^T, P = Q Q^T, (a^T b / a^T a) a, best approximation, projection matrix Symbols: element of, real numbers, square root, sum

Last updated: 22 October 2026 19:04