## Rotation

☆.  Rotation about the x, y, z axis

\begin{align}
R_x(\theta) &=
\begin{bmatrix}
1 & 0 & 0\\
0 & \cos\theta & -\sin\theta\\
0 & \sin\theta & \cos\theta
\end{bmatrix} = exp \left (\theta
\begin{bmatrix}
0 & 0 & 0\\
0 & 0 & -1\\
0 & 1 & 0
\end{bmatrix} \right )
\\ \\ \\
R_y(\theta) &=
\begin{bmatrix}
\cos\theta & 0 & \sin\theta\\
0 & 1 & 0\\
-\sin\theta & 0 & \cos\theta
\end{bmatrix} = exp \left (\theta
\begin{bmatrix}
0 & 0 & 1 \\
0 & 0 & 0\\
-1 & 0 & 0
\end{bmatrix} \right )
\\ \\ \\
R_z(\theta) &=
\begin{bmatrix}
\cos\theta & -\sin\theta & 0\\
\sin\theta & \cos\theta & 0\\
0 & 0 & 1
\end{bmatrix} = exp \left ( \theta
\begin{bmatrix}
0 & -1 & 0\\
1 & 0 & 0\\
0 & 0 & 0
\end{bmatrix} \right )
\end{align}

☆.  Rotation about an arbitrary axis. Let $$l$$ be the unit vector and $$θ$$ be the angle.
1. The exponential map. We can derive the Rodrigues’ rotation formula. If Ω is a matrix, we define the exponential of Ω, denoted $$e^Ω$$. Let $$\theta^2 = ω_x^2 + ω_y^2 + ω_z^2$$

\begin{align}
\begin{bmatrix}
0 & -ω_z & ω_y \\
ω_z & 0 & -ω_x \\
-ω_y & ω_x & 0
\end{bmatrix}
\end{align}

\begin{align}
p’ &= e^{\theta ad(l)} p = e^Ω p \\
&= ( I_3 + \frac{\sin \theta}{\theta} Ω + \frac{1 – \cos \theta}{\theta^2} Ω^2 ) p\\
&= ( I_3 + \sin \theta ad(l) + ( 1 – \cos \theta ) ad^2 (l) ) p\\
&= p + \sin \theta ad(l) p + ( 1 – \cos \theta )ad^2 (l) p \\
&= p + \sin \theta (l \times p) +( 1 – \cos \theta )l \times ( l \times p ) \\
&= p + \sin \theta (l \times p) -(1 – \cos \theta )l \times p \times l \\
&= p + \sin \theta (l \times p) -(1 – \cos \theta )((l\cdot l)p – (l \cdot p)l ) \\
&= p + \sin \theta (l \times p) -(1 – \cos \theta )(p – (l \cdot p)l ) \\
&= p \cos \theta + \sin \theta (l \times p) + (1 – \cos \theta )(l \cdot p)l )
\end{align}

2.  Unit quaternions are in bijection with points of the real 3-sphere $$S^3$$ in $$\mathbb R^4$$. Let $$v = l\sin(\frac{\theta}{2})$$，$$w=\cos(\frac{\theta}{2})$$

\begin{align}
q &= \cos(\frac{\theta}{2})+l\sin(\frac{\theta}{2}) = w + v\\
p’&= qpq^{-1} \\
&= (w^{2} – v \cdot v)p + 2w(v \times p) + 2(v \cdot p)v \\
&= p+2w(v \times p) +2v \times (v \times p)
\end{align}