A projection is a linear mapping from to that satisfies . These mappings can be expressed by projection matrices .

Projection Onto Lines

For vector , projection onto line defined by basis vector is

and assuming the dot product, the projection matrix

General Projections

Generalizing to any subspace defined by bases , we have coordinates

projection

and projection matrix

Also, note that to project onto an affine space, we can translate before and after the projection,