# Homogeneous transformation matrix (6)

Kinematics & Universal Numerics
July 25, 2019

## The axis-angle representation (2).

As promised, we prove today that for every vector ${\mathbf{v}}$ in the original coordinate system, the rotation matrix

 $\displaystyle{\mathbf{R}}={\mathbf{S}}_{0}\cdot\text{Rot}_{z}({\theta})\cdot{% \mathbf{S}}_{0}^{T}$ (1)

indeed rotates ${\mathbf{v}}$ around the unit direction ${\mathbf{d}}$ by angle $\theta$. Here

 $\displaystyle{\mathbf{S}}_{0}=\begin{bmatrix}s_{\psi}&c_{\phi}c_{\psi}&s_{\phi% }c_{\psi}\\ -c_{\psi}&c_{\phi}s_{\psi}&s_{\phi}s_{\psi}\\ &-s_{\phi}&c_{\phi}\end{bmatrix}\quad\text{and}\quad{\mathbf{d}}=\begin{% bmatrix}s_{\phi}c_{\psi}\\ s_{\phi}s_{\psi}\\ c_{\phi}\end{bmatrix}={\mathbf{S}}_{0}\begin{bmatrix}0\\ 0\\ 1\end{bmatrix}={\mathbf{S}}_{0}{\mathbf{e}}_{1,3}.$ (2)

Recall first

 $\text{Rot}_{z}({\theta})=\begin{bmatrix}c_{\theta}&-s_{\theta}\\ s_{\theta}&c_{\theta}\\ &&1\end{bmatrix}\quad\text{so}\quad\text{Rot}_{z}({\theta}){\mathbf{e}}_{1,3}=% {\mathbf{e}}_{1,3}.$

Without loss of generality, we assume ${\mathbf{v}}$ is also a unit vector. After the rotation, we let ${\mathbf{u}}$ denote the resulting unit vector

 ${\mathbf{u}}={\mathbf{R}}{\mathbf{v}}=({\mathbf{S}}_{0}\cdot\text{Rot}_{z}({% \theta})\cdot{\mathbf{S}}_{0}^{T}){\mathbf{v}}.$ (3)

Our proof consists of two parts:

1. (i)

The angle between ${\mathbf{d}}$ and ${\mathbf{v}}$ equals the angle between ${\mathbf{d}}$ and ${\mathbf{u}}$. That is, the dot products of these two pairs are equal.

2. (ii)

Let ${\mathbf{n}}_{1}$ denote the unit vector that is parallel with the cross product of ${\mathbf{d}}$ and ${\mathbf{v}}$. Similarly, let ${\mathbf{n}}_{2}$ be such a vector for ${\mathbf{d}}$ and ${\mathbf{u}}$. Then the angle between ${\mathbf{n}}_{1}$ and ${\mathbf{n}}_{2}$ is $\theta$, and their cross product is ${\mathbf{d}}$.

We prove (i) first by evaluating directly the dot product.

 $\displaystyle{\mathbf{d}}^{T}{\mathbf{v}}$ $\displaystyle=({\mathbf{S}}_{0}{\mathbf{e}}_{1,3})^{T}{\mathbf{v}}={\mathbf{e}% }_{1,3}^{T}({\mathbf{S}}_{0}^{T}{\mathbf{v}})$ (substitute ${\mathbf{d}}$ using (2)) $\displaystyle={\mathbf{e}}_{1,3}^{T}\left(\text{Rot}_{z}({\theta})^{-1}{% \mathbf{S}}_{0}^{-1}{\mathbf{u}}\right)$ (substitute ${\mathbf{u}}$ for ${\mathbf{v}}$ using (3)) $\displaystyle=\left({\mathbf{e}}_{1,3}^{T}\text{Rot}_{z}({-\theta})\right)% \left({\mathbf{S}}_{0}^{T}{\mathbf{u}}\right)$ $\displaystyle={\mathbf{e}}_{1,3}^{T}{\mathbf{S}}_{0}^{T}{\mathbf{u}}={\mathbf{% d}}^{T}{\mathbf{u}}$ (use (2) again).

Therefore, the angle between ${\mathbf{d}}$ and ${\mathbf{v}}$ and that between ${\mathbf{d}}$ and ${\mathbf{u}}$ are the same. We denote this angle by $\alpha$, so ${\mathbf{d}}^{T}{\mathbf{v}}={\mathbf{d}}^{T}{\mathbf{u}}=c_{\alpha}$.

To prove (ii), we first note that

 \left\{\begin{aligned} \displaystyle s_{\alpha}{\mathbf{n}}_{1}&\displaystyle=% {\mathbf{d}}\times{\mathbf{v}}\\ \displaystyle s_{\alpha}{\mathbf{n}}_{2}&\displaystyle={\mathbf{d}}\times{% \mathbf{u}}.\end{aligned}\right.

For any four vectors ${\mathbf{a}},\,{\mathbf{b}},\,{\mathbf{c}},\,{\mathbf{d}}$, an identity holds for the following scalar triple product:

 $({\mathbf{a}}\times{\mathbf{b}})^{T}({\mathbf{c}}\times{\mathbf{d}})=({\mathbf% {a}}^{T}{\mathbf{c}})({\mathbf{b}}^{T}{\mathbf{d}})-({\mathbf{a}}^{T}{\mathbf{% d}})({\mathbf{b}}^{T}{\mathbf{c}}).$

The angle between ${\mathbf{n}}_{1}$ and ${\mathbf{n}}_{2}$ is revealed by their dot product, so we first derive

 $\displaystyle\phantom{=\ }(s_{\alpha}{\mathbf{n}}_{1})^{T}(s_{\alpha}{\mathbf{% n}}_{2})$ $\displaystyle=({\mathbf{d}}\times{\mathbf{v}})^{T}({\mathbf{d}}\times{\mathbf{% u}})$ $\displaystyle=({\mathbf{d}}^{T}{\mathbf{d}})({\mathbf{v}}^{T}{\mathbf{u}})-({% \mathbf{d}}^{T}{\mathbf{u}})({\mathbf{d}}^{T}{\mathbf{v}})$ (use the identity) $\displaystyle={\mathbf{v}}^{T}{\mathbf{I}}{\mathbf{u}}-{\mathbf{v}}^{T}{% \mathbf{d}}{\mathbf{d}}^{T}{\mathbf{u}}$ (reorganize multiplications) $\displaystyle={\mathbf{v}}^{T}({\mathbf{I}}-{\mathbf{d}}{\mathbf{d}}^{T}){% \mathbf{u}}$ (do factorization) $\displaystyle={\mathbf{v}}^{T}({\mathbf{I}}-{\mathbf{d}}{\mathbf{d}}^{T})\left% ({\mathbf{S}}_{0}\cdot\text{Rot}_{z}({\theta})\cdot{\mathbf{S}}_{0}^{T}\right)% {\mathbf{v}}.$ (plug in ${\mathbf{u}}$ in (3)) $\displaystyle={\mathbf{v}}^{T}({\mathbf{I}}-{\mathbf{S}}_{0}{\mathbf{e}}_{1,3}% {\mathbf{e}}_{1,3}^{T}{\mathbf{S}}_{0}^{T})\left({\mathbf{S}}_{0}\cdot\text{% Rot}_{z}({\theta})\cdot{\mathbf{S}}_{0}^{T}\right){\mathbf{v}}.$ (plug in ${\mathbf{d}}$ in (2)) $\displaystyle={\mathbf{v}}^{T}{\mathbf{S}}_{0}\left(\text{Rot}_{z}({\theta})-{% \mathbf{e}}_{1,3}{\mathbf{e}}_{1,3}^{T}\right){\mathbf{S}}_{0}^{T}{\mathbf{v}}$ (simplify and do factorization) $\displaystyle={\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}c_{\theta}&-s_{% \theta}\\ s_{\theta}&c_{\theta}\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}$ (expand) $\displaystyle=s_{\theta}{\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}&-1\\ 1&\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}+c_{\theta}{\mathbf{v}}^{T}{% \mathbf{S}}_{0}\begin{bmatrix}1&\\ &1\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}$ (separate terms) $\displaystyle=:s_{\theta}A+c_{\theta}B$ (derive scalars $A,\,B$ below).

We claim

 $A={\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}&-1\\ 1&\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}=0$

because

 $\displaystyle A=A^{T}$ $\displaystyle=\left({\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}&-1\\ 1&\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}\right)^{T}={\mathbf{v}}^{T}{% \mathbf{S}}_{0}\begin{bmatrix}&1\\ -1&\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}$ $\displaystyle=-{\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}&-1\\ 1&\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}=-A.$

In essence, this is the proof for ${\mathbf{v}}^{T}{\mathbf{A}}{\mathbf{v}}=0$ for any vector ${\mathbf{v}}$ and a skew-symmetric matrix ${\mathbf{A}}$. A matrix is skew-symmetric if it is the opposite of its transpose: ${\mathbf{A}}^{T}=-{\mathbf{A}}$.

For the second scalar $B$, we have

 $\displaystyle B$ $\displaystyle={\mathbf{v}}^{T}{\mathbf{S}}_{0}\begin{bmatrix}1&\\ &1\\ &&0\end{bmatrix}{\mathbf{S}}_{0}^{T}{\mathbf{v}}$ $\displaystyle={\mathbf{v}}^{T}{\mathbf{S}}_{0}({\mathbf{I}}-{\mathbf{e}}_{1,3}% {\mathbf{e}}_{1,3}^{T}){\mathbf{S}}_{0}^{T}{\mathbf{v}}$ $\displaystyle={\mathbf{v}}^{T}{\mathbf{S}}_{0}{\mathbf{S}}_{0}^{T}{\mathbf{v}}% -{\mathbf{v}}^{T}({\mathbf{S}}_{0}{\mathbf{e}}_{1,3})({\mathbf{S}}_{0}{\mathbf% {e}}_{1,3})^{T}{\mathbf{v}}$ $\displaystyle=1-{\mathbf{v}}^{T}{\mathbf{d}}{\mathbf{d}}^{T}{\mathbf{v}}$ $\displaystyle=1-c_{\alpha}^{2}=s_{\alpha}^{2},$

for ${\mathbf{S}}_{0}{\mathbf{e}}_{1,3}={\mathbf{d}}$ by (2). Hence

 $(s_{\alpha}{\mathbf{n}}_{1})^{T}(s_{\alpha}{\mathbf{n}}_{2})=({\mathbf{d}}% \times{\mathbf{v}})^{T}({\mathbf{d}}\times{\mathbf{u}})=s_{\alpha}^{2}c_{% \theta},$

and thus

 $\displaystyle s_{\alpha}^{2}\left({\mathbf{n}}_{1}^{T}{\mathbf{n}}_{2}-c_{% \theta}\right)=0.$

If $s_{\alpha}=0$ and hence $\alpha=0$ or $\pi$, then vectors ${\mathbf{d}},\,{\mathbf{v}},\,{\mathbf{u}}$ align, so the rotation angle $\theta$ simply does not matter. Otherwise if $s_{\alpha}\neq 0$ and hence $\alpha\neq 0$ nor $\pi$, then ${\mathbf{d}}$ and ${\mathbf{v}}$ do not align, so

 ${\mathbf{n}}_{1}^{T}{\mathbf{n}}_{2}=c_{\theta},$

which means that the rotation is indeed $\theta$.

Lastly, it is simple to show

 $\displaystyle(s_{\alpha}{\mathbf{n}}_{1})\times(s_{\alpha}{\mathbf{n}}_{2})$ $\displaystyle=({\mathbf{d}}\times{\mathbf{v}})\times({\mathbf{d}}\times{% \mathbf{u}})=s_{\alpha}^{2}{\mathbf{d}},$

because ${\mathbf{d}}$ is perpendicular to both ${\mathbf{d}}\times{\mathbf{v}}$ and ${\mathbf{d}}\times{\mathbf{u}}$ and

 $|{\mathbf{d}}\times{\mathbf{v}}|=|{\mathbf{d}}\times{\mathbf{u}}|=s_{\alpha}.$

In case where $s_{\alpha}\neq 0$, we have

 ${\mathbf{n}}_{1}\times{\mathbf{n}}_{2}={\mathbf{d}},$

which means that the rotation axis is indeed ${\mathbf{d}}$.