Linear Algebra
6.812 min read

Orthogonal Projection

Every vector bRm\mathbf{b} \in \mathbb{R}^m can be split uniquely into two pieces: one piece inside a subspace VV, and one piece in VV^\perp. This decomposition b=v+z\mathbf{b} = \mathbf{v} + \mathbf{z} (with vV\mathbf{v} \in V, zV\mathbf{z} \in V^\perp) is guaranteed to exist and be unique — this is the Orthogonal Projection Theorem.

Given an orthonormal basis UU for VV, the projection is computed as v=UUtb\mathbf{v} = UU^t\mathbf{b} (apply weight finding to all of b\mathbf{b}, not just vectors in VV). The perpendicular piece is z=bv\mathbf{z} = \mathbf{b} - \mathbf{v}. The key fact is that zV\mathbf{z} \in V^\perp: you can verify Utz=Ut(bUUtb)=UtbUtb=0U^t \mathbf{z} = U^t(\mathbf{b} - UU^t\mathbf{b}) = U^t\mathbf{b} - U^t\mathbf{b} = \mathbf{0}.

The component v=UUtb\mathbf{v} = UU^t\mathbf{b} is called the orthogonal projection of b\mathbf{b} onto VV, written ProjV(b)\text{Proj}_V(\mathbf{b}). The matrix P=UUtP = UU^t is called the projection matrix for VV. Importantly, PP does not depend on the choice of orthonormal basis — any orthonormal basis for VV gives the same PP.

Formal View

Theorem 6.14 — Orthogonal Projection Theorem
Let VV be an nn-dimensional subspace of Rm\mathbb{R}^m. For every bRm\mathbf{b} \in \mathbb{R}^m, there is a unique decomposition b=v+z\mathbf{b} = \mathbf{v} + \mathbf{z} with vV\mathbf{v} \in V and zV\mathbf{z} \in V^\perp.
Definition 6.15 — Orthogonal Projection
In the decomposition above, v\mathbf{v} is called the orthogonal projection of b\mathbf{b} onto VV, written ProjV(b)\text{Proj}_V(\mathbf{b}). If UU is any matrix with orthonormal columns spanning VV, then
ProjV(b)=UUtb.\text{Proj}_V(\mathbf{b}) = UU^t\mathbf{b}.
The matrix P=UUtP = UU^t is the projection matrix for VV.

For the 1D case with V=Span(a)V = \text{Span}(\mathbf{a}): ProjV(b)=baaaa\text{Proj}_V(\mathbf{b}) = \frac{\mathbf{b} \cdot \mathbf{a}}{\mathbf{a} \cdot \mathbf{a}} \mathbf{a}.

Interactive Visualization

Orthogonal Projection

Why This Matters

Orthogonal projection is the mathematical foundation of every "best fit" calculation in science and engineering.

  • Least-squares regression: the best-fit line projects the response vector onto the column space of the design matrix
  • Gram-Schmidt orthogonalization is repeated projection: each new vector is projected away from the previous ones
  • Computer graphics: projecting 3D objects onto a 2D screen, or a viewpoint onto a surface normal
  • Signal denoising: projecting a noisy signal onto the subspace of "smooth" signals removes the high-frequency noise component

Quiz

Question 1

The projection matrix P=UUtP = UU^t satisfies P2=?P^2 = ?

Question 2

The orthogonal projection of b\mathbf{b} onto VV is always inside VV.

Question 3

For a 1D subspace V=Span(a)V = \text{Span}(\mathbf{a}), the projection of b\mathbf{b} onto VV is:

Common Mistakes

  • Computing UUtbUU^t\mathbf{b} for a matrix UU whose columns are NOT orthonormal — the formula ProjV=UUt\text{Proj}_V = UU^t only works with orthonormal columns.
  • Thinking the projection matrix P=UUtP = UU^t is the identity — PP only fixes vectors already in VV; it sends others to their projection.
  • Confusing the projection ProjV(b)V\text{Proj}_V(\mathbf{b}) \in V with the error z=bProjV(b)V\mathbf{z} = \mathbf{b} - \text{Proj}_V(\mathbf{b}) \in V^\perp.