Linear Algebra: VII Orthonormal Matrices
Orthonormal Matrices
A square $n$ by $n$ matrix $Q$ is called orthonormal if:
$$ QQ^\top = Q^\top Q = I $$
$$ Q^{-1} = Q^\top $$
The columns $\vec{q}_1, \ldots, \vec{q}_n$ of $Q$ (and the rows) form an orthonormal basis of $\mathbb{R}^n$:
$$ \vec{q}_i^\top \vec{q}_j = 0 \text{ if } i \neq j, \quad \|\vec{q}_i\| = 1 $$
An orthonormal matrix preserves inner products / dot products:
$$ (Q\vec{x})^\top(Q\vec{y}) = \vec{x}^\top Q^\top Q \vec{y} = \vec{x}^\top I \vec{y} = \vec{x}^\top \vec{y} $$
An orthonormal matrix also preserves magnitude:
$$ \|Q\vec{x}\|^2 = (Q\vec{x})^\top Q\vec{x} = \vec{x}^\top Q^\top Q \vec{x} = \vec{x}^\top I \vec{x} = \vec{x}^\top \vec{x} = \|\vec{x}\|^2 $$
So an orthonormal matrix preserves angles between vectors:
$$ \cos{\theta} = \frac{(Q\vec{x})^\top(Q\vec{y})}{\|Q\vec{x}\|\|Q\vec{y}\|} = \frac{\vec{x}^\top \vec{y}}{\|\vec{x}\|\|\vec{y}\|} $$
There are two special types of orthogonal matrices.
First, a reflection matrix $(Q^{\text{ref}})_\theta$ reflects a vector $\vec{v}$ across a line in $\mathbb{R}^2$ or a plane in $\mathbb{R}^n$ with respect to the unit normal vector $\hat{n}$ that is orthonormal to the line or plane of reflection through the origin. The angle of reflection is:
$$ \theta = \arcsin \Big(\frac{\hat{n}^\top\vec{v}}{\|\vec{v}\|} \Big) $$
A reflection is given by projecting $\vec{v}$ onto $\hat{n}$ using a projection matrix $\hat{n}\hat{n}^\top$ and subtracting this twice from $\vec{v}$:
$$ (Q^{\text{ref}})_\theta \vec{v}= \left( I -2\,\hat{n}\hat{n}^\top\right)\vec{v} $$
Consider the line through the origin $y=mx$ in $\mathbb{R}^2$. Let $\hat{d}$ be a unit direction vector of the line $y=mx$ where $\theta = \arctan(m)$ is the angle between the line and the $x$-axis:
$$ \hat{d} = \begin{bmatrix} \cos{\theta}\\ \sin{\theta} \end{bmatrix} $$
Let $\hat{n}$ be a unit normal vector so that $\hat{d}^\top \hat{n} = 0$:
$$ \hat{n} = \begin{bmatrix} \cos(\theta + \frac{\pi}{2})\\ \sin(\theta + \frac{\pi}{2}) \end{bmatrix} = \begin{bmatrix} -\sin{\theta}\\ \cos{\theta} \end{bmatrix} $$
Then using the double angle identities:
$$ (Q^{\text{ref}})_\theta = \left( \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} - 2 \begin{bmatrix} -\sin\theta \\ \cos\theta \end{bmatrix} \begin{bmatrix} -\sin\theta & \cos\theta \end{bmatrix} \right) $$
$$ = \begin{bmatrix} 1 - 2\sin^2\theta & 2\sin\theta \cos\theta \\ 2\sin\theta \cos\theta & 1 - 2\cos^2\theta \end{bmatrix} $$
$$ = \begin{bmatrix} \cos(2\theta) & \sin(2\theta) \\ \sin(2\theta) & -\cos(2\theta) \end{bmatrix} $$
Where
$$ [(Q^{\text{ref}})_{\theta}]^{-1} = [(Q^{\text{ref}})_{\theta}]^\top = (Q^{\text{ref}})_{\theta} $$
And
$$ \det((Q^{\text{ref}})_{\theta}) = -1 $$Second, a rotation matrix $(Q^{\text{rot}})_{\theta}$ rotates a vector counterclockwise around the origin by $\theta$ in $\mathbb{R}^2$ or around an axis through the origin by $\theta$ in $\mathbb{R}^3$.
Reflecting across two lines (in $\mathbb{R}^2$) or two planes (in $\mathbb{R}^3$) through the origin, with respect to unit normal vectors $\hat{n}_1$ and $\hat{n}_2$, is equivalent to a rotation. In $\mathbb{R}^2$, the composition of two reflections across lines through the origin with unit direction vectors $\hat{d}_1$ and $\hat{d}_2$ produces a rotation about the origin by $\theta$, where $\theta$ is twice the angle between the two lines (equivalently, twice the angle between the unit normal vectors):
$$ \theta = 2 \arccos\!\left(\hat{d}_1^\top \hat{d}_2\right) = 2 \arccos\!\left(\hat{n}_1^\top \hat{n}_2\right) $$
In $\mathbb{R}^3$, the composition of two reflections across planes through the origin produces a rotation about the line of intersection of the planes (with unit direction vector $\hat{n}_1 \times \hat{n}_2$) by $\theta$, where $\theta$ is twice the angle between the two planes (equivalently, twice the angle between the unit normal vectors):
$$ \theta = 2 \arccos\!\left(\hat{n}_1^\top \hat{n}_2\right) $$
A rotation can always be written as a product of two other rotations in infinitely many ways:
$$ Q^{\text{rot}}_{\theta_1 + \theta_2}\,\vec{v} = (Q^{\text{rot}})_{\theta_2} (Q^{\text{rot}})_{\theta_1} \,\vec{v} $$
A rotation can also always be written as a product of two reflections in infinitely many ways:
$$ Q^{\text{rot}}_{\theta}\,\vec{v} = (Q^{\text{ref}})_{\theta_2} (Q^{\text{ref}})_{\theta_1} \,\vec{v} $$
Where
$$ \theta = 2\arccos(\hat{n}_1^\top \hat{n}_2) $$
$$ \theta_1 = \arcsin \Big(\frac{\hat{n}_1^\top \vec{v}}{\|\vec{v}\|} \Big) $$
$$ \theta_2 = \arcsin \Big(\frac{\hat{n}_2^\top (Q^{\text{ref}})_{\theta_1} \,\vec{v}}{\|(Q^{\text{ref}})_{\theta_1} \,\vec{v}\|} \Big) $$
In $\mathbb{R}^3$, one can reflect across two planes containing the line of rotation such that $\theta = \arccos(\hat{n}_1^\top \hat{n}_2)$. In $\mathbb{R}^2$, one can reflect across the $x$-axis and then reflect across the line $y=\tan(\frac{\theta}{2})x$ to obtain a rotation by $\theta$ since:
$$ \arccos(\hat{n}_1^\top \hat{n}_2) = \arccos \Big( \begin{bmatrix} 0 & 1 \end{bmatrix} \begin{bmatrix} -\sin(\theta) \\ \cos(\theta) \end{bmatrix} \Big) $$
$$ = \arccos(\cos(\theta)) = \theta $$
$$ Q^{\text{rot}}_{\theta} = (Q^{\text{ref}})_{\frac{\theta}{2}} (Q^{\text{ref}})_{0} $$
$$ = \begin{bmatrix} \cos{\theta} & \sin{\theta} \\ \sin{\theta} & -\cos{\theta} \end{bmatrix} \left(I - 2 \begin{bmatrix} 0 \\ 1 \end{bmatrix} \begin{bmatrix} 0 & 1 \end{bmatrix} \right) $$
$$ = \begin{bmatrix} \cos{\theta} & \sin{\theta} \\ \sin{\theta} & -\cos{\theta} \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} $$
$$ = \begin{bmatrix} \cos{\theta} & -\sin{\theta} \\ \sin{\theta} & \cos{\theta} \end{bmatrix} $$
Where
$$ [(Q^{\text{rot}})_{\theta}]^{-1} = [(Q^{\text{rot}})_{\theta}]^\top = (Q^{\text{rot}})_{-\theta} $$
And
$$ \det((Q^{\text{rot}})_{\theta}) = 1 $$
Every $n$ by $n$ orthonormal matrix can be expressed as the product of at most $n$ reflection matrices, where even products can be rewritten as rotation matrices.
Comments
Post a Comment