Rotation around an arbitrary axis
Let \(\vec{p}\) be a point vector, \(\alpha\) an angle, \(\hat{r}\) a unit axis vector. The expression \[ \vec{p}' = \vec{p}\cos\left(\alpha\right) + \cross{\hat{r}}{\vec{p}} \sin\left(\alpha\right) + \hat{r} \left(\dot{\hat{r}}{\vec{p}}\right)\left(1-\cos\left(\alpha\right)\right) \] is called the Rodrigues' Rotation Formula and representation a rotation by the angle \(\alpha\) around the axis \(\hat{r}\).
We derive an alternative form \[ \vec{p}' = \rejection{\vec{p}}{\hat{r}}\cos\left(\alpha\right) + \cross{\hat{r}}{\vec{p}} \sin\left(\alpha\right) + \projection{\vec{p}}{\hat{r}} \] of the Rodrigues' Rotation Formula.
Proof
\[\begin{aligned}
&\vec{p}'\\
&=\vec{p}\cos\left(\alpha\right)
\cross{\hat{r}}{\vec{p}} \sin\left(\alpha\right)
\hat{r} (\dot{\hat{r}}{\vec{p}})\left(1-\cos\left(\alpha\right)\right)\\
&=\vec{p}\cos(\alpha) + \cross{\hat{r}}{\vec{p}} \sin(\alpha) + u (\dot{\hat{r}}{\vec{p}}) - \hat{r} (\dot{\hat{r}}{\vec{p}}) \cos(\alpha)\\
&=[\vec{p} - \hat{r} (\dot{\hat{r}}{\vec{p}})]\cos(\alpha) + (\cross{\hat{r}}{\vec{p}}) \sin(\alpha) + u (\dot{u}{\vec{p}})\\
&=[v - u (\dot{u}{\vec{p}})]\cos(\alpha) + \cross{\hat{r}}{\vec{p}} \sin(\alpha) + u (\dot{u}{\vec{p}})
\end{aligned}\]
By the definition of the vector projection
and rejection it follows the projection and rejection of \(\vec{p}\) on \(\hat{r}\) is defined as
\[\begin{aligned}
&\projection{\vec{p}}{\hat{r}} = \frac{\dot{\vec{p}}{\hat{r}}}{\norm{\hat{r}}^2}\hat{r} = \hat{r} (\dot{\hat{r}}{\vec{p}})\\
&\rejection{\vec{p}}{\hat{r}} = \vec{p} - \projection{\vec{p}}{\hat{r}}
\end{aligned}\]
\[\begin{aligned}
&=\rejection{\vec{p}}{\hat{r}}\cos(\alpha) + \cross{\hat{r}}{\vec{p}} \sin(\alpha) + \projection{\vec{p}}{\hat{r}}
\end{aligned}\]