Core Pure · Linear Transformations · Year 1

Linear Transformations in Three Dimensions

Every idea from 2D transformations extends naturally into space — 3×3 matrices reflect in planes and rotate about axes, one dimension richer than before.

16 min read 4 worked examples

3×3 transformation matrices

Definition 28.1 — transformations in 3D

A $3\times3$ matrix transforms points in three dimensions the same way a $2\times2$ matrix does in two: the columns are the images of $\mathbf{i}=(1,0,0)$, $\mathbf{j}=(0,1,0)$, $\mathbf{k}=(0,0,1)$.

Standard reflection matrices in 3D

A reflection in the plane $x=0$ (the $yz$-plane, so $x\to-x$) is represented by the matrix:

$$\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}$$

A reflection in the plane $y=0$ (the $xz$-plane, so $y\to-y$) is represented by the matrix:

$$\begin{pmatrix}1&0&0\\0&-1&0\\0&0&1\end{pmatrix}$$

A reflection in the plane $z=0$ (the $xy$-plane, so $z\to-z$) is represented by the matrix:

$$\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}$$
Definition 28.2 — rotation about a coordinate axis

A rotation, angle $\theta$, about the $x$-axis is represented by the matrix:

$$\begin{pmatrix}1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{pmatrix}$$

A rotation, angle $\theta$, about the $y$-axis is represented by the matrix:

$$\begin{pmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{pmatrix}$$

A rotation, angle $\theta$, about the $z$-axis is represented by the matrix:

$$\begin{pmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{pmatrix}$$
A 3D coordinate system with x, y and z axes, showing a solid rotating about the z-axis with a curved arrow indicating the direction of rotation in the xy-plane
Fig. 1 — rotation about the z-axis leaves the z-coordinate unchanged and rotates the x–y plane, matching the top-left 2×2 block of the rotation matrix.
Example 1 · A reflection in 3D
Write down the $3\times3$ matrix representing a reflection in the $xy$-plane, and find the image of $(2,-3,5)$.

$M=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}$.

$M\begin{pmatrix}2\\-3\\5\end{pmatrix}=\begin{pmatrix}2\\-3\\-5\end{pmatrix}$.

Example 2 · Rotation about the y-axis
Write down the matrix for a rotation of $90°$ about the $y$-axis (with the rotation taking the positive $z$-axis towards the positive $x$-axis), and find the image of $(1,4,0)$.

Rotation about the $y$-axis takes the form $\begin{pmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{pmatrix}$ with $\theta=90°$: $\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}$.

$\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}\begin{pmatrix}1\\4\\0\end{pmatrix}=\begin{pmatrix}0\\4\\-1\end{pmatrix}$.

Composing 3D transformations

Example 3 · Composing two 3D transformations
Find the image of the point $(1,2,3)$ under a rotation by $90°$ about the $z$-axis, followed by reflection in the $xy$-plane.

Rotation matrix with $\theta=90°$: $R=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}$. Reflection matrix: $F=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}$.

Combined matrix (rotation first, so it's on the right): $FR$.

$$FR=\begin{pmatrix}1&0&0\\0&1&0\\0&0&-1\end{pmatrix}\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&-1\end{pmatrix}$$
$$FR\begin{pmatrix}1\\2\\3\end{pmatrix}=\begin{pmatrix}-2\\1\\-3\end{pmatrix}$$
Example 4 · Identifying a 3D transformation from its matrix
Describe the transformation given by $M=\begin{pmatrix}1&0&0\\0&0&-1\\0&1&0\end{pmatrix}$.

$\mathbf{i}\to\mathbf{i}$ (unchanged), $\mathbf{j}\to(0,0,1)=\mathbf{k}$, $\mathbf{k}\to(0,-1,0)=-\mathbf{j}$.

Comparing with the rotation-about-$x$-axis pattern $\begin{pmatrix}1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{pmatrix}$: $\cos\theta=0,\sin\theta=1 \Rightarrow \theta=90°$.

$M$ represents a rotation of $90°$ about the $x$-axis.

Common mistake

Writing $M_1M_2$ instead of $M_2M_1$ for "$M_1$ then $M_2$" applies in 3D exactly as in 2D — since matrix multiplication is not commutative, the two orders generally give completely different transformations.

Exam-style questions

Question 1 3 marks

Write down the $3\times3$ matrix for a rotation of $180°$ about the $x$-axis (leaving $x$ unchanged, reversing $y$ and $z$), and find the image of $(2,3,-1)$.

$\begin{pmatrix}1&0&0\\0&-1&0\\0&0&-1\end{pmatrix}$ (B1)

$\begin{pmatrix}1&0&0\\0&-1&0\\0&0&-1\end{pmatrix}\begin{pmatrix}2\\3\\-1\end{pmatrix}=\begin{pmatrix}2\\-3\\1\end{pmatrix}$ (M1, A1)

Question 2 4 marks

Find the matrix representing reflection in the $yz$-plane followed by rotation of $90°$ about the $z$-axis, and use it to find the image of $(1,0,4)$.

$F=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}$, $R=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}$; combined matrix is $RF$ (B1)

$RF=\begin{pmatrix}0&-1&0\\1&0&0\\0&0&1\end{pmatrix}\begin{pmatrix}-1&0&0\\0&1&0\\0&0&1\end{pmatrix}=\begin{pmatrix}0&-1&0\\-1&0&0\\0&0&1\end{pmatrix}$ (M1, A1)

$RF\begin{pmatrix}1\\0\\4\end{pmatrix}=\begin{pmatrix}0\\-1\\4\end{pmatrix}$ (A1)

Question 3 3 marks

Describe the transformation given by $M=\begin{pmatrix}0&0&1\\0&1&0\\-1&0&0\end{pmatrix}$.

Comparing with the rotation-about-$y$-axis pattern $\begin{pmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{pmatrix}$: $\cos\theta=0$, $\sin\theta=1 \Rightarrow \theta=90°$ (M1, A1)

$M$ represents a rotation of $90°$ about the $y$-axis. (A1)