Tutorials › Linear Algebra › Reflections Across Lines in R^2

Orthogonal Matrices and Isometries · Tutorial 715 of 1000

Reflections Across Lines in R^2

Derive the matrix for reflecting across a line at angle theta, and verify its geometric and algebraic properties through exact examples.

Intermediate 9 min read

What You'll Learn

  • Represent reflection using coordinates parallel and perpendicular to the line.
  • Derive the reflection matrix in standard coordinates using angle-doubling identities.
  • Verify that the reflection matrix is orthogonal and has determinant minus one.
  • Prove that the line is exactly the set of vectors left unchanged.
  • Reflect vectors by matrix multiplication and check the result.

Reflection in Coordinates Adapted to a Line

A reflection across a line through the origin keeps points on the line fixed and reverses the perpendicular component of every vector. This description is simple when coordinates are measured parallel and perpendicular to the line. The main task is to translate that action back into the usual coordinates in \(\mathbb{R}^2\). We will derive the matrix and then verify directly that it preserves lengths and reverses orientation.

Let \(\theta\) be the angle measured counterclockwise from the positive \(x\)-axis to the line. A direction vector along the line and a perpendicular unit vector are

$$ \mathbf{u}= \begin{bmatrix}\cos\theta\\ \sin\theta\end{bmatrix}, \qquad \mathbf{n}= \begin{bmatrix}-\sin\theta\\ \cos\theta\end{bmatrix}. $$

Both vectors have length \(1\), and their dot product is \(-\cos\theta\sin\theta+\sin\theta\cos\theta=0\). Thus \((\mathbf{u},\mathbf{n})\) is an orthonormal basis of \(\mathbb{R}^2\). Every vector \(\mathbf{x}\) has a unique expression \(\mathbf{x}=a\mathbf{u}+b\mathbf{n}\), where \(a=\mathbf{u}^{\top}\mathbf{x}\) and \(b=\mathbf{n}^{\top}\mathbf{x}\). Reflection across the line keeps the \(a\)-component and changes the sign of the \(b\)-component.

Definition: Reflection across the line spanned by \(\mathbf{u}\) is the linear map \(T:\mathbb{R}^2\to\mathbb{R}^2\) defined by \(T(a\mathbf{u}+b\mathbf{n})=a\mathbf{u}-b\mathbf{n}\). Its matrix in standard coordinates is the reflection matrix for that line.

To convert from the adapted basis to standard coordinates, let \(\mathbf{Q}\) have columns \(\mathbf{u}\) and \(\mathbf{n}\). Then \(\mathbf{Q}\) is orthogonal: its columns are orthonormal, so \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_2\). The coordinates of \(\mathbf{x}\) in the adapted basis are \(\mathbf{Q}^{\top}\mathbf{x}\). In those coordinates reflection is represented by \(\begin{bmatrix}1&0\\0&-1\end{bmatrix}\). Converting back gives the standard-coordinate matrix

$$ \mathbf{S}_{\theta} = \mathbf{Q} \begin{bmatrix}1&0\\0&-1\end{bmatrix} \mathbf{Q}^{\top}. $$

Multiplying these matrices gives an explicit formula. Write \(c=\cos\theta\) and \(s=\sin\theta\), so \(\mathbf{Q}=\begin{bmatrix}c&-s\\s&c\end{bmatrix}\). First,

$$ \mathbf{Q} \begin{bmatrix}1&0\\0&-1\end{bmatrix} = \begin{bmatrix}c&s\\s&-c\end{bmatrix}, \qquad \mathbf{Q}^{\top}= \begin{bmatrix}c&s\\-s&c\end{bmatrix}. $$

Therefore

$$ \mathbf{S}_{\theta} = \begin{bmatrix}c&s\\s&-c\end{bmatrix} \begin{bmatrix}c&s\\-s&c\end{bmatrix} = \begin{bmatrix}c^2-s^2&2cs\\2cs&s^2-c^2\end{bmatrix} = \begin{bmatrix}\cos(2\theta)&\sin(2\theta)\\ \sin(2\theta)&-\cos(2\theta)\end{bmatrix}. $$

The last equality uses the double-angle identities \(\cos(2\theta)=\cos^2\theta-\sin^2\theta\) and \(\sin(2\theta)=2\sin\theta\cos\theta\). The angle doubles because the orientation of the line affects both the direction of the component to preserve and the perpendicular direction to reverse.

Properties of the Reflection Matrix

Theorem: For every real \(\theta\), the matrix \(\mathbf{S}_{\theta}\) above represents reflection across the line spanned by \(\mathbf{u}=(\cos\theta,\sin\theta)^{\top}\). It is orthogonal, its determinant is \(-1\), and it sends \(\mathbf{u}\) to \(\mathbf{u}\) and \(\mathbf{n}\) to \(-\mathbf{n}\).

Proof. The coordinate construction defines a linear map: in the basis \((\mathbf{u},\mathbf{n})\), it sends coordinates \((a,b)^{\top}\) to \((a,-b)^{\top}\). Thus it fixes every multiple of \(\mathbf{u}\) and reverses every multiple of \(\mathbf{n}\), which is precisely reflection across the line. The matrix formula follows from converting coordinates using \(\mathbf{Q}\), as shown above. Since \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_2\) and \(\mathbf{D}=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\) satisfies \(\mathbf{D}^{\top}\mathbf{D}=\mathbf{I}_2\), we have \(\mathbf{S}_{\theta}^{\top}\mathbf{S}_{\theta}=\mathbf{Q}\mathbf{D}^{\top}\mathbf{Q}^{\top}\mathbf{Q}\mathbf{D}\mathbf{Q}^{\top}=\mathbf{Q}\mathbf{I}_2\mathbf{Q}^{\top}=\mathbf{I}_2\). So \(\mathbf{S}_{\theta}\) is orthogonal. Also \(\det\mathbf{Q}=c^2+s^2=1\), \(\det\mathbf{D}=-1\), and \(\det\mathbf{Q}^{\top}=1\), giving \(\det\mathbf{S}_{\theta}=-1\). Finally, the defining action gives \(\mathbf{S}_{\theta}\mathbf{u}=\mathbf{u}\) and \(\mathbf{S}_{\theta}\mathbf{n}=-\mathbf{n}\). \(\square\)

These properties provide useful checks. Orthogonality implies preservation of dot products and lengths, while determinant \(-1\) distinguishes a reflection from a rotation, whose determinant is \(1\). A further consequence is that applying the reflection twice returns the original vector: both coordinates \((a,b)\) undergo \((a,b)\mapsto(a,-b)\mapsto(a,b)\).

Theorem: The vectors fixed by \(\mathbf{S}_{\theta}\), meaning those satisfying \(\mathbf{S}_{\theta}\mathbf{x}=\mathbf{x}\), are exactly the vectors on the reflecting line.

Proof. Write an arbitrary vector as \(\mathbf{x}=a\mathbf{u}+b\mathbf{n}\). By the definition of reflection, \(\mathbf{S}_{\theta}\mathbf{x}=a\mathbf{u}-b\mathbf{n}\). Equality with \(\mathbf{x}\) is equivalent to \(a\mathbf{u}-b\mathbf{n}=a\mathbf{u}+b\mathbf{n}\), hence \(2b\mathbf{n}=\mathbf{0}\). Since \(\mathbf{n}\) is a unit vector, it is nonzero, so this equation holds exactly when \(b=0\). In that case \(\mathbf{x}=a\mathbf{u}\) is on the line. Conversely, if \(\mathbf{x}=a\mathbf{u}\), the defining rule gives \(\mathbf{S}_{\theta}\mathbf{x}=a\mathbf{u}=\mathbf{x}\). \(\square\)

Computing Reflections

Worked Example: Reflection Across the Line at 45 Degrees

Reflect \(\mathbf{x}=(2,-1)^{\top}\) across the line making angle \(\theta=\pi/4\) with the positive \(x\)-axis.

Here \(2\theta=\pi/2\), so \(\cos(2\theta)=0\) and \(\sin(2\theta)=1\). The matrix is

$$ \mathbf{S}_{\pi/4} = \begin{bmatrix}0&1\\1&0\end{bmatrix}. $$

Multiplying by the vector gives

$$ \mathbf{S}_{\pi/4}\mathbf{x} = \begin{bmatrix}0&1\\1&0\end{bmatrix} \begin{bmatrix}2\\-1\end{bmatrix} = \begin{bmatrix}0\cdot2+1\cdot(-1)\\1\cdot2+0\cdot(-1)\end{bmatrix} = \begin{bmatrix}-1\\2\end{bmatrix}. $$

Check: Applying the matrix again gives \(\begin{bmatrix}0&1\\1&0\end{bmatrix}\begin{bmatrix}-1\\2\end{bmatrix}=\begin{bmatrix}2\\-1\end{bmatrix}\), the original vector. Also, the reflecting line is \(y=x\); the coordinates of the result are the original coordinates exchanged, as expected for reflection across that line.

Worked Example: Reflection Across a 30-Degree Line

Reflect \(\mathbf{x}=(2,0)^{\top}\) across the line at \(\theta=\pi/6\). Since \(2\theta=\pi/3\), the double-angle values are \(\cos(2\theta)=1/2\) and \(\sin(2\theta)=\sqrt{3}/2\). Thus

$$ \mathbf{S}_{\pi/6} = \begin{bmatrix}\frac12&\frac{\sqrt3}{2}\\ \frac{\sqrt3}{2}&-\frac12\end{bmatrix}. $$

Multiply row by column, showing both entries:

$$ \mathbf{S}_{\pi/6}\mathbf{x} = \begin{bmatrix}\frac12&\frac{\sqrt3}{2}\\ \frac{\sqrt3}{2}&-\frac12\end{bmatrix} \begin{bmatrix}2\\0\end{bmatrix} = \begin{bmatrix}\frac12(2)+\frac{\sqrt3}{2}(0)\\ \frac{\sqrt3}{2}(2)-\frac12(0)\end{bmatrix} = \begin{bmatrix}1\\\sqrt3\end{bmatrix}. $$

Check: Reflect the answer once more: \(\mathbf{S}_{\pi/6}\begin{bmatrix}1\\\sqrt3\end{bmatrix} =\begin{bmatrix}\frac12+\frac32\\\frac{\sqrt3}{2}-\frac{\sqrt3}{2}\end{bmatrix} =\begin{bmatrix}2\\0\end{bmatrix}\). The norm is also unchanged: the input has squared norm \(2^2+0^2=4\), and the output has squared norm \(1^2+(\sqrt3)^2=4\).

Worked Example: A Vector on the Reflecting Line

Reflect \(\mathbf{x}=(2,1)^{\top}\) across the line at angle \(\theta=\pi/3\). Now \(2\theta=2\pi/3\), so \(\cos(2\theta)=-1/2\) and \(\sin(2\theta)=\sqrt3/2\). Therefore

$$ \mathbf{S}_{\pi/3} = \begin{bmatrix}-\frac12&\frac{\sqrt3}{2}\\ \frac{\sqrt3}{2}&\frac12\end{bmatrix}, \qquad \mathbf{S}_{\pi/3}\mathbf{x} = \begin{bmatrix}-\frac12(2)+\frac{\sqrt3}{2}(1)\\ \frac{\sqrt3}{2}(2)+\frac12(1)\end{bmatrix} = \begin{bmatrix}-1+\frac{\sqrt3}{2}\\ \sqrt3+\frac12\end{bmatrix}. $$

Check: Applying \(\mathbf{S}_{\pi/3}\) to this output gives first coordinate \(\frac12-\frac{\sqrt3}{4}+\frac{3}{2}+\frac{\sqrt3}{4}=2\) and second coordinate \(-\frac{\sqrt3}{2}+\frac14+\frac{\sqrt3}{2}+\frac34=1\). Thus the result reflects back to \((2,1)^{\top}\). The input is not on the line at angle \(\pi/3\), so a changed vector is expected.

Angles, Checks, and a Common Sign Error

A line has no preferred direction: the angles \(\theta\) and \(\theta+\pi\) describe the same line. The formula respects this fact because \(\cos(2(\theta+\pi))=\cos(2\theta+2\pi)=\cos(2\theta)\) and \(\sin(2(\theta+\pi))=\sin(2\theta+2\pi)=\sin(2\theta)\). So the reflection matrix does not depend on which of the two opposite directions along the line is chosen.

When checking a computed reflection, two tests are especially effective. First, apply the same matrix a second time: the result must be the input, because the perpendicular component is reversed twice. Second, check that the norm is preserved; orthogonality guarantees \(\|\mathbf{S}_{\theta}\mathbf{x}\|=\|\mathbf{x}\|\). These checks detect many arithmetic errors, though neither replaces writing down the matrix and multiplication carefully.

Common mistake: using the rotation matrix instead of the reflection matrix. At \(\theta=\pi/4\), a sign error in the off-diagonal entries might produce \(\begin{bmatrix}0&-1\\1&0\end{bmatrix}\). This is a rotation matrix, not a reflection matrix: it sends \((1,0)^{\top}\) to \((0,1)^{\top}\), whereas reflection across \(y=x\) should send \((1,0)^{\top}\) to \((0,1)^{\top}\)—this single vector does not expose the error. Test instead \((0,1)^{\top}\): reflection should send it to \((1,0)^{\top}\), but the incorrect matrix sends it to \((-1,0)^{\top}\). The correct formula has equal off-diagonal entries, \(\sin(2\theta)\), because reflecting across \(y=x\) exchanges the two coordinates.

There is a useful algebraic way to distinguish the two kinds of transformation. For a reflection, \(\mathbf{S}_{\theta}^{2}=\mathbf{I}_2\) and \(\det\mathbf{S}_{\theta}=-1\). A nontrivial rotation generally does not square to the identity and has determinant \(1\). Thus the action on a particular vector can be checked against the geometric definition, while the square and determinant help identify the type of matrix.

Check Your Understanding

Use the angle-doubling formula and verify calculations by applying the reflection a second time.

  1. Write the reflection matrix for the line at angle \(\theta=0\), and state what it does to \((3,-2)^{\top}\).
  2. Reflect \((1,2)^{\top}\) across the line at \(\theta=\pi/4\).
  3. For \(\theta=\pi/6\), verify directly that \(\mathbf{S}_{\theta}\mathbf{u}=\mathbf{u}\) for \(\mathbf{u}=(\cos\theta,\sin\theta)^{\top}\).
  4. Explain why the lines at angles \(\theta\) and \(\theta+\pi\) have the same reflection matrix.
  5. What are the determinant and the square of a reflection matrix, and what do these properties mean geometrically?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon