Orthogonal Matrices

Most matrices bend space: they stretch some directions, squash others, and turn squares into slanted parallelograms. A few don't bend anything. They turn space, or mirror it, and every length, every angle, and every shape comes out exactly as it went in. A robot arm swinging a part, a camera turning to face a scene, a satellite tumbling in orbit: all of them are moved by these matrices. Their columns are orthonormal, their inverse costs nothing to compute, and in numerical work they are the one kind of matrix that never makes rounding errors worse. This page is about them, in $\R^n$, with a close look at $\R^2$ and $\R^3$.

Pick up a cube and turn it in your hand. Its edges stay the same length and its corners stay square; nothing about its shape changes, only which way it faces. Hold it up to a mirror and the same is true of its reflection. The matrices that move space like that, turns and mirrors that never bend anything, are the subject of this page. Here is the whole idea in one picture.

The cube's three edges from the corner at $0$ are where $e_1$, $e_2$, $e_3$ land, so they are the three columns of the matrix. A turn or a mirror leaves them as three edges of a unit cube: length $1$ each, and square to each other. That's the definition.

The rotation matrix $R_\theta$ and the mirror across a line were two of the plane's basic moves, back when every move was its own picture. This page finds what the two have in common, and shows that, in the plane, they are the only moves of their kind.

Orthonormal Columns

On Gram–Schmidt & QR, a matrix with orthonormal columns satisfied $Q^tQ = I$: entry $(i, j)$ of $Q^tQ$ is the dot product of columns $i$ and $j$. When such a matrix is square, it gets a name.

A matrix whose columns are the edges of a turned (or mirrored) unit cube has columns that are orthonormal: each has length $1$, and every two are square to each other.

An orthogonal matrix is a square matrix $Q$ whose columns are orthonormal; equivalently, $Q^tQ = I$.

A $2 \times 2$ or $3 \times 3$ matrix $Q$ is an orthogonal matrix if its columns all have length $1$ and every two of them are square to each other; equivalently, $Q^tQ = I$.

Here are the columns of one such matrix, grown out of the unit cube's edges.

Checking the definition takes one length per column and one dot product per pair of columns. Hefferon starts with three candidates.

Which of these are orthogonal matrices?

$$A = \begin{pmatrix} \frac{1}{\sqrt2} & -\frac{1}{\sqrt2} \\ -\frac{1}{\sqrt2} & -\frac{1}{\sqrt2} \end{pmatrix}, \qquad B = \begin{pmatrix} \frac{1}{\sqrt3} & -\frac{1}{\sqrt3} \\ -\frac{1}{\sqrt3} & -\frac{1}{\sqrt3} \end{pmatrix}, \qquad C = \begin{pmatrix} \frac{1}{\sqrt3} & -\frac{\sqrt2}{\sqrt3} \\ -\frac{\sqrt2}{\sqrt3} & -\frac{1}{\sqrt3} \end{pmatrix}.$$

$A$: each column has length $\sqrt{\frac12 + \frac12} = 1$, and the dot product of the columns is $-\frac12 + \frac12 = 0$. Orthogonal.

$B$: the columns are square to each other ($-\frac13 + \frac13 = 0$), but each has length $\sqrt{\frac13 + \frac13} = \sqrt{\frac23}$, not $1$. Not orthogonal.

$C$: the lengths are $\sqrt{\frac13 + \frac23} = 1$ and $\sqrt{\frac23 + \frac13} = 1$, and the dot product is $-\frac{\sqrt2}{3} + \frac{\sqrt2}{3} = 0$. Orthogonal.

$B$ is the trap: square columns aren't enough, and the name doesn't help.

An orthogonal matrix has orthonormal columns, not just orthogonal ones, so "orthonormal matrix" would be the better name. Hefferon actually uses it, but nearly everyone else says "orthogonal matrix," and so does this site. Whenever you read "orthogonal matrix," check lengths as well as dot products.

The equation $Q^tQ = I$ says the transpose undoes $Q$ from the left. For a square matrix, that's enough to make it the inverse.

If $Q$ is an orthogonal matrix, then $Q$ is invertible and $Q^{-1} = Q^t$. So $QQ^t = I$ as well, and the rows of $Q$ are orthonormal too.

Show proof

If $Qx = 0$, then $x = Ix = Q^tQx = Q^t0 = 0$, so $Q$ has only the trivial null space, and a square matrix with that property is invertible. Multiply $Q^tQ = I$ on the right by $Q^{-1}$: $Q^t = Q^{-1}$. Then $QQ^t = QQ^{-1} = I$, and entry $(i, j)$ of $QQ^t$ is row $i$ of $Q$ times row $j$ of $Q$, so the rows are orthonormal. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. The rows of $Q^t$ are the columns of $Q$, so each entry of $Q^tQ$ is a dot product of two columns. A column with itself gives its length squared, $1$; two different columns give $0$. Fill in the table and out comes $I$: $Q^t$ undoes whatever $Q$ did. Undoing a turn of the cube is just turning it back, and undoing a mirror is mirroring again, so $Q$ really does have an inverse, and it's $Q^t$.

The full proof is in the n version.

That makes solving $Qx = b$ almost free: no elimination, just one multiplication by the transpose.

Solve $Qx = (1, 4, 1)$ for $Q = \frac13\begin{pmatrix} 2 & -1 & 2 \\ 2 & 2 & -1 \\ -1 & 2 & 2 \end{pmatrix}$.


First, $Q$ is orthogonal: the columns $\frac13(2, 2, -1)$, $\frac13(-1, 2, 2)$, $\frac13(2, -1, 2)$ each have length $\frac13\sqrt{4 + 4 + 1} = 1$, and the dot products $\frac19(-2 + 4 - 2)$, $\frac19(4 - 2 - 2)$, $\frac19(-2 - 2 + 4)$ are all $0$. So $x = Q^tb$:

$$x = \frac13\begin{pmatrix} 2 & 2 & -1 \\ -1 & 2 & 2 \\ 2 & -1 & 2 \end{pmatrix}\begin{pmatrix} 1 \\ 4 \\ 1 \end{pmatrix} = \frac13\begin{pmatrix} 9 \\ 9 \\ 0 \end{pmatrix} = \begin{pmatrix} 3 \\ 3 \\ 0 \end{pmatrix}.$$

Check: $Q(3, 3, 0) = \frac13(6 - 3, \ 6 + 6, \ -3 + 6) = (1, 4, 1)$.

In pictures: $x$ is just $b$ read in the turned cube's coordinates. Each entry of $x$ is the dot product of $b$ with one column, the shadow of $b$ on one edge of the cube.

Keep the $\frac13$ in front through the whole calculation; dropping it, or using it twice, are the two usual slips. Your turn. In free response, type the entries separated by commas, like 3, 3, 0.

Loading practice engine...

What Orthogonal Matrices Keep

The opening cube suggested that orthogonal matrices keep lengths and angles. They do, and nothing else does: keeping lengths alone already forces a matrix to be orthogonal.

For an $n \times n$ matrix $Q$, these are equivalent:

  1. $Q^tQ = I$.
  2. The columns of $Q$ are orthonormal.
  3. $Q$ keeps dot products: $Qx \cdot Qy = x \cdot y$ for all $x, y$ in $\R^n$.
  4. $Q$ keeps lengths: $\|Qx\| = \|x\|$ for all $x$ in $\R^n$.
Show proof

(1) $\iff$ (2): entry $(i, j)$ of $Q^tQ$ is the dot product of columns $i$ and $j$ (orthonormal columns), so $Q^tQ = I$ says exactly that those dot products are $1$ on the diagonal and $0$ off it.

(1) $\implies$ (3): $Qx \cdot Qy = (Qx)^t(Qy) = x^tQ^tQy = x^ty = x \cdot y$, using $(AB)^t = B^tA^t$.

(3) $\implies$ (4): take $y = x$ and a square root.

(4) $\implies$ (3): lengths determine dot products, since $\|x + y\|^2 - \|x - y\|^2 = 4\,x \cdot y$. So $4\,Qx \cdot Qy = \|Qx + Qy\|^2 - \|Qx - Qy\|^2 = \|Q(x + y)\|^2 - \|Q(x - y)\|^2 = \|x + y\|^2 - \|x - y\|^2 = 4\,x \cdot y$.

(3) $\implies$ (2): column $i$ is $Qe_i$, and $Qe_i \cdot Qe_j = e_i \cdot e_j$, which is $1$ when $i = j$ and $0$ otherwise. $\blacksquare$

For a $2 \times 2$ or $3 \times 3$ matrix $Q$, these say the same thing:

  1. $Q$ is orthogonal: its columns have length $1$ and are square to each other.
  2. $Q$ keeps every length: $\|Qx\| = \|x\|$.
  3. $Q$ keeps every angle between two arrows, and every dot product: $Qx \cdot Qy = x \cdot y$.
Why it's true (picture)

This is a visual argument, not a formal proof, and it uses three facts from geometry class: the Pythagorean theorem, its converse, and SSS congruence. An arrow $x = (3, 2)$ is the diagonal of a rectangle with sides $3e_1$ and $2e_2$. If the columns are orthonormal, $Q$ sends those sides to $3Qe_1$ and $2Qe_2$: still lengths $3$ and $2$, still at a right angle. A rectangle with the same sides has the same diagonal, so $\|Qx\| = \|x\|$. (In space it's a box, and Pythagoras twice.)

Backward: if $Q$ keeps lengths, then $Qe_1$ and $Qe_2$ have length $1$, and $Qe_1 + Qe_2 = Q(1, 1)$ has length $\sqrt2$. A triangle with sides $1$, $1$, $\sqrt 2$ has a right angle, since $1^2 + 1^2 = (\sqrt2)^2$, so the columns are square. And angles: the triangle with corners $0$, $x$, $y$ has sides $\|x\|$, $\|y\|$, $\|x - y\|$, all kept, so its image is a congruent triangle and the angle at $0$ is the same.

The full proof is in the n version.

Here is the theorem checked on numbers, with the $3$-$4$-$5$ turn.

Let $Q = \frac15\begin{pmatrix} 3 & -4 \\ 4 & 3 \end{pmatrix}$, $x = (2, 1)$, and $y = (-1, 3)$. Compare $\|Qx\|$ with $\|x\|$, and $Qx \cdot Qy$ with $x \cdot y$.


$Qx = \frac15(6 - 4, \ 8 + 3) = \frac15(2, 11)$, so $\|Qx\| = \frac15\sqrt{4 + 121} = \frac{\sqrt{125}}{5} = \sqrt5$, and $\|x\| = \sqrt{4 + 1} = \sqrt5$. The same.

$Qy = \frac15(-3 - 12, \ -4 + 9) = \frac15(-15, 5) = (-3, 1)$, so $Qx \cdot Qy = \frac15(-6 + 11) = 1$, and $x \cdot y = -2 + 3 = 1$. The same again.

So the angle between $Qx$ and $Qy$ matches the angle between $x$ and $y$: $Q$ (a turn by about $53^\circ$) carried the pair around rigidly.

In practice the theorem runs the other way: you know lengths and dot products of $u$ and $v$, and you never need $Q$ at all. In free response, type one number.

Loading practice engine...

Determinant, Products, and Inverses

Since an orthogonal matrix keeps the unit cube a unit cube, it keeps volume. That pins down its determinant up to a sign.

Every orthogonal matrix $Q$ has $\det(Q) = 1$ or $\det(Q) = -1$.

Show proof

$1 = \det(I) = \det(Q^tQ) = \det(Q^t)\det(Q) = \det(Q)^2$, by the product rule and $\det(Q^t) = \det(Q)$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. The size of $\det(Q)$ is how much $Q$ scales volume (Determinants as Volume), and $Q$ sends the unit cube to another unit cube, of volume $1$. So $\det(Q)$ is $1$ or $-1$, and the sign says whether the cube's corner kept its handedness: a turn keeps it, a mirror flips it.

The full proof is in the n version.

The two signs split orthogonal matrices into turns (determinant $1$) and mirror-type moves (determinant $-1$). But the theorem doesn't run backward.

The shear keeps the area, which is all a determinant measures. It just doesn't keep the shape.

Determinant $\pm 1$ is necessary, not sufficient. The shear $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$ has determinant $1$ and keeps area, but its second column has length $\sqrt2$, so it stretches some lengths and bends the square's corner to $45^\circ$. To test for orthogonal, check the columns.

Orthogonal matrices also hang together: doing two of them in a row, or undoing one, gives another.

If $Q_1$ and $Q_2$ are orthogonal matrices of the same size, then $Q_1Q_2$ is orthogonal, and so is $Q_1^{-1} = Q_1^t$.

Show proof

$(Q_1Q_2)^t(Q_1Q_2) = Q_2^tQ_1^tQ_1Q_2 = Q_2^tIQ_2 = Q_2^tQ_2 = I$. And $(Q_1^t)^tQ_1^t = Q_1Q_1^t = I$ by the inverse theorem. $\blacksquare$

Why it's true (a short check)

Two moves that each keep every length, done one after the other, keep every length; and undoing a move that keeps lengths keeps lengths. By the theorem above, keeping lengths is the same as being orthogonal. The full proof is in the n version.

Sums are a different story: $I + I = 2I$ doubles every length. Products, yes; sums, no.

Turns and mirrors are the only moves that never bend anything, and they still managed to get named after the one property (square columns) that isn't enough on its own. I'd like to speak to whoever is in charge of names.

Every 2 × 2 Orthogonal Matrix

In the plane there's a complete list, and finding it takes one picture. The first column has length $1$, so it sits on the unit circle at some angle $\theta$. The second column also has length $1$ and is square to the first, which leaves exactly two places for it.

That's the whole proof, written out below. Hefferon tells the same story in his Topic on orthonormal matrices.

Every $2 \times 2$ orthogonal matrix is one of

$$R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} \qquad \text{or} \qquad \begin{pmatrix} \cos\theta & \sin\theta \\ \sin\theta & -\cos\theta \end{pmatrix}.$$

The first, with determinant $1$, is the rotation by $\theta$. The second, with determinant $-1$, is the reflection in the line through $0$ at angle $\frac{\theta}{2}$.

Show proof

The first column is a unit vector, so it is $(\cos\theta, \sin\theta)$ for some $\theta$. The second column $(a, b)$ is a unit vector with $a\cos\theta + b\sin\theta = 0$. The vectors square to $(\cos\theta, \sin\theta)$ are the multiples of $(-\sin\theta, \cos\theta)$, and the unit ones are $\pm(-\sin\theta, \cos\theta)$. The plus sign gives $R_\theta$, the rotation matrix. The minus sign gives the second matrix, call it $S$. Let $d = (\cos\frac\theta2, \sin\frac\theta2)$ and $d' = (-\sin\frac\theta2, \cos\frac\theta2)$, the unit vectors along and square to the line at angle $\frac\theta2$. The double-angle formulas give $Sd = (\cos\theta\cos\frac\theta2 + \sin\theta\sin\frac\theta2, \ \sin\theta\cos\frac\theta2 - \cos\theta\sin\frac\theta2) = (\cos\frac\theta2, \sin\frac\theta2) = d$, and in the same way $Sd' = -d'$. A linear map that fixes the line and flips the direction square to it is the reflection in that line. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. It's the figure above: once the first column sits at angle $\theta$ on the circle, the second is a quarter turn ahead of it or a quarter turn behind. A quarter turn ahead keeps the corner from $e_1$ to $e_2$ counterclockwise, so the whole plane has just turned by $\theta$. A quarter turn behind flips that corner over, so the plane has been mirrored, and the mirror has to lie halfway between $e_1$ and where $e_1$ lands, at angle $\frac\theta2$, because a mirror swaps a point with its image. The full proof is in the n version.

So to name a $2 \times 2$ orthogonal matrix, read the determinant (turn or mirror) and the first column (the angle).

What move is $Q = \frac15\begin{pmatrix} 3 & 4 \\ 4 & -3 \end{pmatrix}$?


$\det(Q) = \frac{1}{25}(-9 - 16) = -1$, so it's a mirror. The first column is $(\cos\theta, \sin\theta) = \left(\frac35, \frac45\right)$, and the mirror line sits at half of that angle. The line halfway between $e_1$ and $\left(\frac35, \frac45\right)$ runs along their sum, $\left(\frac85, \frac45\right)$, which points along $(2, 1)$: the mirror is the line $y = \frac12 x$. Check: $Q(2, 1) = \frac15(6 + 4, \ 8 - 3) = (2, 1)$, so the line stays put, and $Q(-1, 2) = \frac15(-3 + 8, \ -4 - 6) = (1, -2)$, so the direction square to it flips.

Watch every point jump straight across that line.

Now build some yourself: put the first column anywhere on the circle, then find the two spots that make the matrix orthogonal.

Place the Second Column

Every other spot for $q_2$ bends the F; only those two keep it a perfect copy, turned or flipped. Your turn to name some moves.

Loading practice engine...

In Space: Every Turn Has an Axis

A turn of the plane moves every point except $0$. A turn of space can't: some line always holds still, the axis it turns around. Spin a globe and the poles stay put; there's no way to turn a ball that moves every point on it. In matrix terms, the eigenvalue $1$ is forced.

Let $Q$ be a $3 \times 3$ orthogonal matrix.

  1. If $\det(Q) = 1$, then $Q$ is a turn about an axis: there is a unit vector $a$ with $Qa = a$, and $Q$ turns the plane square to $a$ in itself by an angle $\theta$, with $\tr(Q) = 1 + 2\cos\theta$.
  2. If $\det(Q) = -1$, then $-Q$ is such a turn, so $Q$ is a turn followed by $x \mapsto -x$.
Show proof

(1) $\det(Q - I) = \det(Q^t)\det(Q - I) = \det(Q^tQ - Q^t) = \det(I - Q^t) = \det\left((I - Q)^t\right) = \det(I - Q) = (-1)^3\det(Q - I)$, using $\det(Q^t) = \det(Q) = 1$. So $\det(Q - I) = 0$, and $1$ is an eigenvalue: pick a unit eigenvector $a$. If $x \cdot a = 0$, then $Qx \cdot a = Qx \cdot Qa = x \cdot a = 0$, so $Q$ maps the plane $\mathsf{W}$ square to $a$ into itself. Take an orthonormal basis $v, w$ of $\mathsf{W}$ and form the orthogonal matrix $P$ with columns $a, v, w$. Then $P^tQP = \begin{pmatrix} 1 & 0 \\ 0 & B \end{pmatrix}$ with $B$ a $2 \times 2$ block, and $P^tQP$ is orthogonal (a product of orthogonal matrices), so $B$ has orthonormal columns. Also $\det(B) = \det(P^tQP) = \det(Q) = 1$, so by the 2 × 2 theorem, $B = R_\theta$ for some $\theta$. Similar matrices have the same trace, so $\tr(Q) = 1 + 2\cos\theta$.

(2) $\det(-Q) = (-1)^3\det(Q) = 1$, and $-Q$ is orthogonal, so (1) applies to $-Q$; then $Q = -(-Q)$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Why an axis? A $3 \times 3$ matrix always has a real eigenvalue, since its characteristic polynomial is a cubic and a cubic crosses the axis. An eigenvector's arrow gets stretched by $\lambda$ but $Q$ keeps lengths, so $\lambda$ is $1$ or $-1$. The three eigenvalues multiply to $\det(Q) = 1$; if the other two are a complex pair, their product is positive, so the real one is $1$; if all three are real, they are $\pm1$ with an even number of $-1$'s, so at least one is $1$. Either way some arrow $a$ has $Qa = a$: the axis.

The plane square to the axis stays square to it, because $Q$ keeps angles. Inside that plane, $Q$ is a $2 \times 2$ orthogonal move that doesn't flip anything, so by the last section it's a turn by some angle $\theta$. The trace adds up what happens in three square directions: $1$ along the axis, and $\cos\theta + \cos\theta$ in the turning plane.

The full proof is in the n version.

The trace formula is the quick way to read the angle; the axis comes from solving $(Q - I)a = 0$.

Find the axis and the angle of $Q = \frac13\begin{pmatrix} 2 & -1 & 2 \\ 2 & 2 & -1 \\ -1 & 2 & 2 \end{pmatrix}$, the matrix from the first example.


We checked it is orthogonal, and $\det(Q) = 1$ (expand, or trust the next line), so it's a turn. The axis solves $(Q - I)a = 0$:

$$Q - I = \frac13\begin{pmatrix} -1 & -1 & 2 \\ 2 & -1 & -1 \\ -1 & 2 & -1 \end{pmatrix},$$

whose rows each add up to $0$, so $a = (1, 1, 1)$ works (and the rank is $2$, so that's the only direction). The angle: $\tr(Q) = \frac{2 + 2 + 2}{3} = 2 = 1 + 2\cos\theta$, so $\cos\theta = \frac12$ and $\theta = 60^\circ$.

Here is that turn: $e_1$, $e_2$, $e_3$ each swing a sixth of the way around the axis and land on the columns of $Q$.

The matrix that sends $e_1 \to e_2 \to e_3 \to e_1$ is a turn about the same axis: its trace is $0$, so $\cos\theta = -\frac12$ and $\theta = 120^\circ$. Your turn. In free response, type the angle in degrees (or the number, when it asks for $\cos\theta$).

Loading practice engine...

Householder Reflections

Mirrors are the building blocks of every orthogonal matrix, and there's a formula for the mirror in any plane through $0$. Describe the mirror by a vector $u$ square to it. To reflect $x$, remove its shadow on $u$ twice: once to land on the mirror, and once more to come out the other side. That shadow is the projection $\frac{x \cdot u}{u \cdot u}u$.

For a nonzero vector $u$ in $\R^n$, the Householder reflection is the $n \times n$ matrix $H = I - \dfrac{2}{u \cdot u}uu^t$, so that $Hx = x - 2\dfrac{x \cdot u}{u \cdot u}u$.

For a nonzero arrow $u$ in $\R^2$ or $\R^3$, the Householder reflection is the mirror in the line (or plane) through $0$ square to $u$: $Hx = x - 2\dfrac{x \cdot u}{u \cdot u}u$. Its matrix is $H = I - \dfrac{2}{u \cdot u}uu^t$.

Here $uu^t$ is a column times a row: a full square matrix whose entry $(i, j)$ is $u_iu_j$. Everything you'd hope for from a mirror is true of $H$.

A Householder reflection $H = I - \frac{2}{u \cdot u}uu^t$ is symmetric and orthogonal, $H^2 = I$, $Hu = -u$, $Hx = x$ whenever $x \cdot u = 0$, and $\det(H) = -1$. In terms of the projection matrix $P = \frac{1}{u \cdot u}uu^t$ onto the line of $u$, $H = I - 2P$.

Show proof

$(uu^t)^t = uu^t$, so $H^t = H$. With $P = \frac{1}{u \cdot u}uu^t$, $P^2 = \frac{1}{(u \cdot u)^2}u(u^tu)u^t = P$, so $H^2 = I - 4P + 4P^2 = I$, and then $H^tH = H^2 = I$. Next, $Hu = u - 2\frac{u \cdot u}{u \cdot u}u = -u$, and $x \cdot u = 0$ gives $Hx = x$. Pick an orthogonal basis $u, w_2, \ldots, w_n$ of $\R^n$ (extend $u$ and run Gram–Schmidt): in it $H$ is diagonal with entries $-1, 1, \ldots, 1$, and similar matrices have the same determinant, so $\det(H) = -1$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Arrows lying in the mirror have no shadow on $u$, so $H$ leaves them alone. The arrow $u$ is all shadow, so subtracting it twice turns $u$ into $-u$. Every other arrow is a piece in the mirror plus a piece along $u$, and $H$ keeps the first piece and flips the second: that's exactly what a mirror does. Mirroring twice puts everything back ($H^2 = I$), a mirror keeps lengths (orthogonal), and it flips handedness ($\det(H) = -1$). The full proof is in the n version.

Here is one written out, and checked against those properties.

Find the Householder reflection for $u = (1, 1, 1)$, and check what it does to $u$ and to $(1, -1, 0)$.


$u \cdot u = 3$ and $uu^t$ is the $3 \times 3$ matrix of all $1$'s, so

$$H = I - \frac23\begin{pmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{pmatrix} = \frac13\begin{pmatrix} 1 & -2 & -2 \\ -2 & 1 & -2 \\ -2 & -2 & 1 \end{pmatrix}.$$

It's symmetric. $H(1, 1, 1) = \frac13(-3, -3, -3) = -(1, 1, 1)$: $u$ flips. And $(1, -1, 0)$ is square to $u$, and $H(1, -1, 0) = \frac13(1 + 2, \ -2 - 1, \ -2 + 2) = (1, -1, 0)$: it lies in the mirror and stays put.

The mirror here is the plane $x + y + z = 0$, which cuts the unit cube's diagonal square in the middle.

The best trick about Householder reflections: given two arrows of the same length, there's a mirror that swaps them, and it's easy to write down.

If $\|x\| = \|y\|$ and $x \neq y$, then the Householder reflection for $u = x - y$ sends $x$ to $y$ (and $y$ to $x$).

Show proof

With $u = x - y$: $u \cdot u = x \cdot x - 2x \cdot y + y \cdot y = 2(x \cdot x - x \cdot y)$, using $x \cdot x = y \cdot y$, and $x \cdot u = x \cdot x - x \cdot y$. So $2\frac{x \cdot u}{u \cdot u} = 1$ and $Hx = x - u = y$. Since $H^2 = I$, $Hy = HHx = x$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. The tips of $x$ and $y$ and the origin make an isosceles triangle, since $\|x\| = \|y\|$. In an isosceles triangle, the line from the apex square to the base bisects the base, so the mirror through $0$ square to the base $x - y$ swaps the two tips. The full proof is in the n version.

That is how a computer zeroes out a column: mirror the column onto $(\|x\|, 0, 0)$.

Find the Householder reflection that sends $x = (3, 4, 0)$ to $(5, 0, 0)$.


Both have length $5$, so take $u = x - (5, 0, 0) = (-2, 4, 0)$, with $u \cdot u = 20$:

$$H = I - \frac{2}{20}\begin{pmatrix} 4 & -8 & 0 \\ -8 & 16 & 0 \\ 0 & 0 & 0 \end{pmatrix} = \frac{1}{10}\begin{pmatrix} 6 & 8 & 0 \\ 8 & -6 & 0 \\ 0 & 0 & 10 \end{pmatrix}.$$

Check: $H(3, 4, 0) = \frac{1}{10}(18 + 32, \ 24 - 24, \ 0) = (5, 0, 0)$. Without the matrix: $x \cdot u = -6 + 16 = 10$, so the shadow is $\frac{10}{20}u = (-1, 2, 0)$, and $x$ minus twice the shadow is $(3, 4, 0) - (-2, 4, 0) = (5, 0, 0)$.

Doing this column after column (each mirror leaving the earlier columns alone) turns any matrix into an upper triangular one, which is a second route to the QR factorization, and the one most software actually uses. Try the mirror yourself; the last mission chains two mirrors together.

Mirror Maker

Two mirrors make a turn, by twice the angle between them; that's the $2 \times 2$ theorem again, since determinants $-1$ and $-1$ multiply to $1$. Your turn: apply a mirror without building its matrix. In free response, type the entries separated by commas; fractions like 7/9 are fine.

Loading practice engine...

Application: Rigid Motions

Euclid called two triangles the same when you could pick one up, slide it, turn it, and set it down exactly on the other, without stretching anything. Robots and animation software do that billions of times a day. Hefferon's Topic gives the moves a name.

A rigid motion of $\R^n$ is a function $f\colon \R^n \to \R^n$ that keeps every distance: $\|f(x) - f(y)\| = \|x - y\|$ for all $x, y$.

A rigid motion of the plane (or of space) is a way of moving every point so that the distance between any two points stays the same.

A slide $x \mapsto x + b$ is a rigid motion that isn't linear, since it moves $0$. It turns out that's the only thing standing between rigid motions and orthogonal matrices.

Every rigid motion has the form $f(x) = Qx + b$, with $Q$ an orthogonal matrix and $b = f(0)$. Conversely, every such $f$ is a rigid motion.

Show proof

Conversely first: $\|Qx + b - (Qy + b)\| = \|Q(x - y)\| = \|x - y\|$. Now let $f$ be a rigid motion and $g(x) = f(x) - f(0)$. Then $g$ keeps distances and $g(0) = 0$, so $\|g(x)\| = \|g(x) - g(0)\| = \|x\|$. Expanding $\|g(x) - g(y)\|^2 = \|x - y\|^2$ and cancelling the lengths gives $g(x) \cdot g(y) = x \cdot y$. So $q_i = g(e_i)$ are orthonormal, and they form an orthonormal basis of $\R^n$ ($n$ of them, and orthonormal vectors are independent). The coordinates of $g(x)$ in that basis are $g(x) \cdot q_i = g(x) \cdot g(e_i) = x \cdot e_i = x_i$, so $g(x) = x_1q_1 + \cdots + x_nq_n = Qx$, where $Q$ has columns $q_i$ and is orthogonal. So $f(x) = Qx + f(0)$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof; it's the one Hefferon gives. In the plane, a point is pinned down by its distances from three points not on one line, say $0$, $e_1$, and $e_2$: one distance puts it on a circle, the second cuts that to two points, the third picks one. A rigid motion keeps all three distances, so $f(P)$ is pinned the same way relative to $f(0)$, $f(e_1)$, $f(e_2)$. Those three images still make a right corner with sides $1$, so after sliding $f(0)$ back to $0$, they're the corner of a turned or mirrored unit square, which is an orthogonal matrix. Every point just comes along for the ride. (In space, add a fourth anchor, $e_3$.)

The full proof is in the n version.

So every rigid motion is a turn or a mirror, followed by a slide. Here are two from Hefferon's exercises.

(a) Write the rigid motion that turns the plane by $30^\circ$ about $0$ and then slides it up by $1$, and find where it sends $(2, 0)$. (b) Write the reflection in the line $y = 2x$.


(a) $f(x) = R_{30^\circ}x + (0, 1)$, with $R_{30^\circ} = \begin{pmatrix} \frac{\sqrt3}{2} & -\frac12 \\ \frac12 & \frac{\sqrt3}{2} \end{pmatrix}$. Then $f(2, 0) = (\sqrt3, 1) + (0, 1) = (\sqrt3, 2)$.

(b) The line $y = 2x$ makes an angle $\varphi$ with $\tan\varphi = 2$, so $\cos\varphi = \frac{1}{\sqrt5}$ and $\sin\varphi = \frac{2}{\sqrt5}$. The mirror's first column is $e_1$ turned by $2\varphi$: $\cos 2\varphi = \frac15 - \frac45 = -\frac35$ and $\sin 2\varphi = 2 \cdot \frac{1}{\sqrt5} \cdot \frac{2}{\sqrt5} = \frac45$. By the $2 \times 2$ theorem the reflection is $\frac15\begin{pmatrix} -3 & 4 \\ 4 & 3 \end{pmatrix}$. Check: it sends $(1, 2)$ to $\frac15(-3 + 8, \ 4 + 6) = (1, 2)$.

Here is part (a) played on a shape.

A computer stores such a move as one $3 \times 3$ matrix $\begin{pmatrix} Q & b \\ 0 & 1 \end{pmatrix}$ acting on homogeneous coordinates, so a chain of moves is one matrix product. And because $Q^{-1} = Q^t$, undoing a move costs nothing: the inverse is $x \mapsto Q^t(x - b)$.

The toolkit for this page: an orthogonal matrix has orthonormal columns, $Q^tQ = I$, so $Q^{-1} = Q^t$ and $Qx = b$ is solved by $x = Q^tb$. It keeps lengths, angles, and dot products, and keeping lengths alone is enough to be orthogonal. $\det(Q) = \pm1$, and products and inverses stay orthogonal. In the plane it's a turn $R_\theta$ or a mirror; in space a turn has an axis and $\tr(Q) = 1 + 2\cos\theta$. The mirror square to $u$ is $H = I - \frac{2}{u \cdot u}uu^t$, and $u = x - y$ swaps two arrows of the same length. Rigid motions are $Qx + b$.

Mixed Practice

Every question so far came right after its idea, which is a hint a quiz never gives you. Down here the hint is gone. First, true or false: a claim from anywhere on this page, and you decide whether it holds.

Loading practice engine...

Next, a mixed set: every question type on this page, shuffled. Type a number or a vector when it asks you to.

Loading practice engine...

Made it this far? Time for something with a little heat: two mirrors in space, one after the other. In free response, type a number (an angle in degrees, or a fraction).

🌶️ SPICY BONUS 🌶️

Loading practice engine...