Simple examples of $3 \times 3$ rotation matrices

Whenever I get a chance to teach Linear algebra I do things like the following to produce "nice" rotation matrices. The basic idea is that a composition of two reflections is always a rotation. Restricting myself to 3D in what follows.

The reason why I think this fits the bill here is that reflections usually have nice matrices. If we reflect $\Bbb{R}^3$ w.r.t. to the plane with normal $\vec{n}=(n_1,n_2,n_3)$, then that reflection $s$ is given by the recipe $$ s(\vec{x})=\vec{x}-2\,\frac{\vec{x}\cdot\vec{n}}{\Vert\vec{n}\Vert^2}\vec{n}. $$ If $\vec{n}$ has rational components, then the matrix of $s$ w.r.t. the standard basis will have rational entries. As we need two reflection to get a rotation, we can either multiply two such matrices, or may be use a very easy choice of $\vec{n}$ for the other.

For example, the reflection w.r.t. the plane $3x+2y+z=0$ with $\vec{n}=(3,2,1)$ sends $$ \begin{aligned} (1,0,0)&\mapsto(1,0,0)-\frac37(3,2,1)=\frac17(-2,-6,-3),\\ (0,1,0)&\mapsto(0,1,0)-\frac27(3,2,1)=\frac17(-6,3,-2),\\ (0,0,1)&\mapsto(0,0,1)-\frac17(3,2,1)=\frac17(-3,-2,6). \end{aligned} $$ If we (post)compose this with the reflection $(x,y,z)\mapsto(-x,y,z)$, we get the rotation represented by the matrix $$ R=\frac17\left( \begin{array}{rrr} 2&6&3\\ -6&3&-2\\ -3&-2&6 \end{array}\right). $$ The axis of rotation here has to be a vector that is perpendicular to both $\vec{n}$ and $(1,0,0)$ (the normal of the second plane of reflection). The cross product $\vec{w}=(0,-1,2)$ is one such vector, and you can easily verify that $R(0,-1,2)^T=(0,-1,2)^T$.


Here are some:

$$\left[ \begin {array}{ccc} 1/3&2/3&2/3\\ 2/3&-2/3&1/3\\ 2/3&1/3&-2/3\end {array} \right] $$ $$\left[ \begin {array}{ccc} 2/7&3/7&6/7\\ 3/7&-6/7&2/7\\ 6/7&2/7&-3/7\end {array} \right] $$ $$ \left[ \begin {array}{ccc} \frac{2}{11}&{\frac {6}{11}}&{\frac {9}{11}}\\ -{\frac {6}{11}}&-{\frac {7}{11}}&{\frac {6}{11}} \\ {\frac {9}{11}}&-{\frac {6}{11}}&\frac{2}{11}\end {array} \right] $$

EDIT: here are the small positive integer solutions of $a^2 + b^2 + c^2 = d^2$ with $a \le b \le c$ and $\gcd(a,b,c,d)=1$, in order of increasing $b^2 + c^2$:

$$\eqalign{1^2 + 2^2 + 2^2 &= 3^2\cr 2^2 + 3^2 + 6^2 &= 7^2\cr 4^2 + 4^2 + 7^2 &= 9^2\cr 1^2 + 4^2 + 8^2 &= 9^2\cr 6^2 + 6^2 + 7^2 &= 11^2\cr 2^2 + 6^2 + 9^2 &= 11^2\cr 3^2 + 4^2 + 12^2 &= 13^2\cr 2^2 + 10^2 + 11^2 &= 15^2\cr 2^2 + 5^2 + 14^2 &= 15^2\cr 8^2 + 9^2 + 12^2 &= 17^2\cr 1^2 + 12^2 + 12^2 &= 17^2\cr }$$


Keep in mind that the product of two rational matrices is going to be a rational matrix too. This allows you to build plenty of rational rotaton matrices by composing them. For instance: $$ \frac15 \begin{pmatrix} 3 & 4 & 0 \\ -4 & 3 & 0 \\ 0 & 0 & 5 \end{pmatrix} \cdot \frac1{13} \begin{pmatrix} 5 & 0 & -12 \\ 0 & 13 & 0 \\ 12 & 0 & 5 \end{pmatrix} = \frac1{65} \begin{pmatrix} 15 & 52 & -36 \\ -20 & 39 & 48 \\ 60 & 0 & 25 \end{pmatrix} $$ and so the latter is also a rational rotation matrix.