Ma · Mathematics

How Do Projection and Reflection Linear Transformations Work?

Published By the 9to5Science editorial team

At a glance

  1. 1. Write the projection

    For a line through the origin with direction vector u, project x using P = uuᵀ/(uᵀu).

  2. 2. Write the reflection

    For reflection across a line, use R = 2P − I; for reflection across the x-axis, use diag(1, −1).

  3. 3. Set the order

    If you project first and reflect second, the composite matrix is RP. Reversing the order gives PR.

  4. 4. Check eigenvalues

    A projection has eigenvalues 0 and 1; a reflection has eigenvalues 1 and −1. A composite may have different eigenvalues.

Projection and reflection are both linear transformations when the subspace or mirror passes through the origin. To combine them, represent each transformation by a matrix and multiply the matrices in the order the transformations are applied. The order matters: projection followed by reflection is generally not the same as reflection followed by projection.

The formulas below use column vectors. They also show why eigenvalues of a composite transformation cannot always be inferred from the eigenvalues of its individual steps.

Projection onto a line

Let a line through the origin have direction vector u≠0u\ne 0. The orthogonal projection of a vector xx onto that line is

Px=uTxuTuu,P x = \frac{u^T x}{u^T u}u,

so its matrix is

P=uuTuTu.P=\frac{uu^T}{u^T u}.

A projection leaves vectors already on the line unchanged and maps vectors perpendicular to it to zero. In matrix terms, P2=PP^2=P: applying the projection twice has the same effect as applying it once. Its eigenvalues can only be 11 and 00: vectors in the projected subspace have eigenvalue 11, and vectors in its orthogonal complement have eigenvalue 00. Both occur when the subspace and its orthogonal complement are nonzero.

For example, the projection onto the line spanned by (1,1)(1,1) uses u=(1,1)Tu=(1,1)^T, giving

P=12(1111).P=\frac12\begin{pmatrix}1&1\\1&1\end{pmatrix}.

Indeed, P(x,y)T=((x+y)/2,(x+y)/2)TP(x,y)^T=((x+y)/2,(x+y)/2)^T.

Reflection across a line

If PP is the orthogonal projection onto a line, reflection across that same line is

R=2P−I.R=2P-I.

A vector on the line stays fixed, while its perpendicular component changes sign. Consequently, reflection matrices satisfy R2=IR^2=I. For a reflection across a line in the plane, the eigenvalues are 11 and −1-1; more generally, both occur when the fixed and reversed subspaces are nonzero.

As a simpler example, reflection across the xx-axis is

Rx=(100−1),R_x=\begin{pmatrix}1&0\\0&-1\end{pmatrix},

because it sends (x,y)(x,y) to (x,−y)(x,-y).

Compose the transformations in the right order

For column vectors, the matrix on the right acts first. Thus:

  • Project, then reflect: x↦Px↦R(Px)x\mapsto Px\mapsto R(Px), so the composite matrix is RPRP.
  • Reflect, then project: x↦Rx↦P(Rx)x\mapsto Rx\mapsto P(Rx), so the composite matrix is PRPR.

These products can differ because matrix multiplication is not generally commutative; for some choices, RP≠PRRP\ne PR.

If the projection and reflection use the same line, then R=2P−IR=2P-I, and

RP=PR=(2P−I)P=2P2−P=P.RP=PR=(2P-I)P=2P^2-P=P.

This makes geometric sense: after projection, the vector lies on the mirror line, so reflecting it does nothing. If the two lines differ, the composite can have a different effect.

Worked example: project onto the diagonal, then reflect across the x-axis

Use the projection matrix onto the line spanned by (1,1)(1,1) and the reflection matrix across the xx-axis:

P=12(1111),Rx=(100−1).P=\frac12\begin{pmatrix}1&1\\1&1\end{pmatrix}, \qquad R_x=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.

Projection comes first, so multiply by PP first and use RxPR_xP:

RxP=(100−1)12(1111)=12(11−1−1).R_xP= \begin{pmatrix}1&0\\0&-1\end{pmatrix} \frac12\begin{pmatrix}1&1\\1&1\end{pmatrix} =\frac12\begin{pmatrix}1&1\\-1&-1\end{pmatrix}.

For a concrete vector (2,4)T(2,4)^T, projection gives (3,3)T(3,3)^T; reflection across the xx-axis then gives (3,−3)T(3,-3)^T. The composite matrix produces the same result:

12(11−1−1)(24)=(3−3).\frac12\begin{pmatrix}1&1\\-1&-1\end{pmatrix} \begin{pmatrix}2\\4\end{pmatrix} = \begin{pmatrix}3\\-3\end{pmatrix}.

This particular composite is not itself a projection or a reflection. Its square is the zero matrix:

(RxP)2=0.(R_xP)^2=0.

Therefore its only eigenvalue is 00. Geometrically, the composite maps every vector to a multiple of (1,−1)T(1,-1)^T, and applying it again gives zero because (1,−1)T(1,-1)^T is perpendicular to the projection line. This illustrates why you should calculate the composite matrix before making claims about its eigenvalues.

Common mistakes

  • Reversing the product: With column vectors, RPRP means apply PP first, then RR. Read the product from right to left.
  • Treating projection and reflection as the same operation: Projection discards the perpendicular component; reflection reverses it.
  • Assuming the composite inherits the eigenvalues: The eigenvalues of RPRP are not generally obtained by combining the eigenvalues of RR and PP.
  • Using a reflection matrix for a mirror not through the origin: Reflection across a line that does not pass through the origin is an affine transformation, not a linear one. It can still be written using matrices in homogeneous coordinates, but it is not represented by an ordinary 2×22\times2 linear map.
  • Forgetting the vector convention: The product order stated here assumes column vectors. Row-vector conventions reverse the way transformations are written.

References

  1. Linear Algebra and Its Applications — David C. Lay, Steven R. Lay, and Judi J. McDonald
  2. Introduction to Linear Algebra — Gilbert Strang

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.