How do I derive an n-dimensional rotation matrix from a geometric perspective? I have read on wikipedia that it preserves distance so that $Q^TQ = I$ but the explanation to be honest isn't very clear. I've had a thorough look on Google and can't find a decent explanation that starts from the geometry first. Also, on Wikipedia (see here: https://en.wikipedia.org/wiki/Rotation_matrix) it says that $det(Q) = 1$ but it isn't clear at all why! Thanks.
Geometric intuition behind an n-dimensional rotation matrix
linear algebralinear-transformationsmatricesrotations
Related Solutions
Others have raised some good points, and a definite answer really depends what kind of a linear transformation do we want call a rotation or a reflection.
For me a reflection (may be I should call it a simple reflection?) is a reflection with respect to a subspace of codimension 1. So in $\mathbf{R}^n$ you get these by fixing a subspace $H$ of dimension $n-1$. The reflection $s_H$ w.r.t. $H$ keeps the vectors of $H$ fixed (pointwise) and multiplies a vector perpendicular to $H$ by $-1$. If $\vec{n}\perp H$, $\vec{n}\neq0$, then $s_H$ is given by the formula
$$\vec{x}\mapsto\vec{x}-2\,\frac{\langle \vec{x},\vec{n}\rangle}{\|\vec{n}\|^2}\,\vec{n}.$$
The reflection $s_H$ has eigenvalue $1$ with multiplicity $n-1$ and eigenvalue $-1$ with multiplicity $1$ with respective eigenspaces $H$ and $\mathbf{R}\vec{n}$. Thus its determinant is $-1$. Therefore geometrically it reverses orientation (or handedness, if you prefer that term), and is not a rigid body motion in the sense that in order to apply that transformation to a rigid 3D body, you need to break it into atoms (caveat: I don't know if this is the standard definition of a rigid body motion?). It does preserve lengths and angles between vectors.
Rotations (by which I, too, mean simply an orthogonal transformations with $\det=1$) have more variation. If $A$ is a rotation matrix, then Adam's calculation proving that the lengths are preserved, tells us that the eigenvalues must have absolute value $=1$ (his calculation goes through for a complex vectors and the Hermitian inner product). Therefore the complex eigenvalues are on the unit circle and come in complex conjugate pairs. If $\lambda=e^{i\varphi}$ is a non-real eigenvalue, and $\vec{v}$ is a corresponding eigenvector (in $\mathbf{C}^n$), then the vector $\vec{v}^*$ gotten by componentwise complex conjugation is an eigenvector of $A$ belonging to eigenvalue $\lambda^*=e^{-i\varphi}$. Consider the set $V_1$ of vectors of the form $z\vec{v}+z^*\vec{v}^*$. By the eigenvalue property this set is stable under $A$: $$A(z\vec{v}+z^*\vec{v}^*)=(\lambda z)\vec{v}+(\lambda z)^*\vec{v}^*.$$ Its components are also stable under complex conjugation, so $V_1\subseteq\mathbf{R}^n$. It is obviously a 2-dimensional subspace, IOW a plane. It is easy to guess and not difficult to prove that the restriction of the transformation $A$ onto the subspace $V_1$ is a rotation by the angle $\varphi_1=\pm\varphi$. Note that we cannot determine the sign of the rotation (clockwise/ccw), because we don't have a preferred handedness on the subspace $V$.
The preservation of angles (see Adam's answer) shows that $A$ then maps the $n-2$ dimensional subspace $V^\perp$ also to itself. Furthermore, the determinant of $A$ restricted to $V_1$ is equal to one, so the same holds for $V_1^\perp$. Thus we can apply induction and keep on splitting off 2-dimensional summands $V_i,i=2,3\ldots,$ such that on each summand $A$ acts as a rotation by some angle $\varphi_i$ (usually distinct from the preceding ones). We can keep doing this until only real eigenvalues remain, and end with the situation: $$ \mathbf{R}^n=V_1\oplus V_2\oplus\cdots V_m \oplus U, $$ where the 2D-subspaces $V_i$ are orthogonal to each other, $A$ rotates a vector in $V_i$ by the angle $\varphi_i$, and $A$ restricted to $U$ has only real eigenvalues.
Counting the determinant will then show that the multiplicity of $-1$ as an eigenvalue of $A$ restricted to $U$ will always be even. As a consequence of that we can also split that eigenspace into sums of 2-dimensional planes, where $A$ acts as rotation by 180 degrees (or multiplication by $-1$). After that there remains the eigenspace belonging to eigenvalue $+1$. The multiplicity of that eigenvalue is congruent to $n$ modulo $2$, so if $n$ is odd, then $\lambda=+1$ will necessarily be an eigenvalue. This is the ultimate reason, why a rotation in 3D-space must have an axis = eigenspace belonging to eigenvalue $+1$.
From this we see:
- As Henning pointed out, we can continuously bring any rotation back to the identity mapping simply by continuously scaling all the rotation angles $\varphi_i,i=1,\ldots,m$ continuously to zero. The same can be done on those summands of $U$, where $A$ acts as rotation by 180 degrees.
- If we want to define rotation in such a way that the set of rotations contains the elementary rotations described by Henning, and also insist that the set of rotations is closed under composition, then the set must consist of all orthogonal transformations with $\det=1$. As a corollary to this rotations preserve handedness. This point is moot, if we defined a rotation by simply requiring the matrix $A$ to be orthogonal and have $\det=1$, but it does show the equivalence of two alternative definitions.
- If $A$ is an orthogonal matrix with $\det=-1$, then composing $A$ with a reflection w.r.t. to any subspace $H$ of codimension one gives a rotation in the sense of this (admittedly semi-private) definition of a rotation.
This is not a full answer in the sense that I can't give you an 'authoritative' definition of an $n$D-rotation. That is to some extent a matter of taste, and some might want to only include the simple rotations from Henning's answer that only "move" points of a 2D-subspace and keep its orthogonal complement pointwise fixed. Hopefully I managed to paint a coherent picture, though.
The way that I picture orientation (for a 2d object) is like this. Say you're given two noncollinear arrow vectors. Translate those two vectors so that their tails are touching. Like this:
Now consider the parallelogram that can be formed by those two vectors. Place a particle on the boundary of this parallelogram and constrain it to stay on the boundary and to traverse the boundary at some constant (and nonzero) angular rate. So if it starts at the origin (where the tails meet) it only has two choices, start moving along $A$ or start moving along $B$. These represent the two different orientations that this planar object can potentially have.
Now consider, if you were to rotate this parallelogram to some other position in $3$-space, will that affect the direction that this particle moves (if the particle were moving in what we'll call the "$A$" direction to begin with, will the particle suddenly start moving in the "$B$" direction if we rotate the entire parallelogram)?
That's how I visualize it.
Best Answer
Suppose $Q$ is an $n\times n$ matrix that preserves distance. Heuristically, that would mean that $$ \Vert Qx-Qy \Vert = \Vert x - y \Vert $$ for all $n$-vectors $x$ and $y$. Now if you use the polarization identity $$ \left<x,y\right> = \frac{1}{4}\left(\Vert x+y \Vert^2 - \Vert x-y\Vert^2\right) $$ you can show that preserving distances is equivalent to preserving the inner product. So $Q$ preserves distances if and only if $$ \left<Qx,Qy\right> = \left<x,y\right> $$ for all $x$ and $y$. Using the defining property of the transpose, we can move it over: $$ \left<Qx,Qy\right> = \left<x,y\right> \implies \left<x,Q^TQy\right> = \left<x,y\right> $$ for all $x$ and $y$. From this follows that $Q^TQ = I$. A nice consequence is that if treat the columns of $Q$ as vectors, they form an othonormal set: each has unit length, and each pair are orthogonal (perpendicular).
Now using determinant properties, you have that $\det Q^2 = \det I = 1$. So $\det Q = \pm 1$.
But this all comes from the distance-preserving property of $Q$. If you consider $\mathbb{R}^n$ as an oriented vector space, you can determine if distance-preserving matrices preserve or reverse the orientation. The condition of preserving the orientation is equivalent to the determinant of $Q$ being $1$.