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
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.
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
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,
Therefore
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
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)\).
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
Multiplying by the vector gives
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
Multiply row by column, showing both entries:
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
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.
- Write the reflection matrix for the line at angle \(\theta=0\), and state what it does to \((3,-2)^{\top}\).
- Reflect \((1,2)^{\top}\) across the line at \(\theta=\pi/4\).
- For \(\theta=\pi/6\), verify directly that \(\mathbf{S}_{\theta}\mathbf{u}=\mathbf{u}\) for \(\mathbf{u}=(\cos\theta,\sin\theta)^{\top}\).
- Explain why the lines at angles \(\theta\) and \(\theta+\pi\) have the same reflection matrix.
- What are the determinant and the square of a reflection matrix, and what do these properties mean geometrically?