☕ biscuits in teaMathematicsProjection: The Shadow of a Vector↑ Top
Essay

Projection: The Shadow of a Vector

Orthogonal projection turns the intuitive idea of a shadow into one of linear algebra's most useful operations.

Projection asks a beautifully simple question:

How much of uu lies in the direction of vv?

Vector u casting an orthogonal shadow onto the line spanned by v.
The projection is the shadow of $u$ on the one-dimensional world spanned by $v$.

For nonzero vv,

projv(u)=uvvvv.\operatorname{proj}_v(u) = \frac{u\cdot v}{v\cdot v}v.

If v^=v/v\hat v=v/\lVert v\rVert is a unit vector, this becomes

projv^(u)=(uv^)v^.\operatorname{proj}_{\hat v}(u)=(u\cdot\hat v)\hat v.

A decomposition

Projection naturally splits a vector into two pieces:

u=u+u,u=u_\parallel+u_\perp,

where uu_\parallel lies along vv and uu_\perp is perpendicular to it.

Vector decomposed into parallel and perpendicular components on a grid.
The original vector is exactly the sum of its parallel component and orthogonal residual.

From shadows to least squares

When a system Ax=bAx=b has no exact solution, least squares finds the point Ax^A\hat x in the column space of AA closest to bb. In other words, it projects bb onto a subspace.

The residual

r=bAx^r=b-A\hat x

must be perpendicular to every column of AA, giving

A(bAx^)=0.A^\top(b-A\hat x)=0.

Hence the normal equations:

AAx^=Ab.A^\top A\hat x=A^\top b.

Projection is therefore not a decorative geometric idea. It is hiding inside regression, approximation, signal processing and machine learning.