Rotation matrix in terms of axis of rotation How to calculate the rotation matrix in 3D in terms of an arbitrary axis of rotation? Given a unit vector $V=V_{x}e_{x}+V_{y}e_{y}+V_{z}e_{z}$ How to calculate the rotation matrix about that axis?
 A: I think you need the Rodrigue's rotation matrix composition.
If your unit rotation axis is $\vec{v} = (V_x,V_y,V_z)$ and the rotation angle $\theta$ then the rotation matrix is

$$ R = \boldsymbol{1}_{3\times3} + \vec{v}\times\,(\sin\theta) + \vec{v}\times\vec{v}\times\,(1-\cos\theta) $$

where $\vec{v}\times = \begin{pmatrix} 0 & -V_z & V_y \\ V_z & 0 & -V_x \\ -V_y & V_x & 0 \end{pmatrix}$ is the $3\times 3$ cross product operator matrix.
For example a rotation about the unit $\vec{v}=(\frac{\sqrt{3}}{3},0,\text{-}\frac{\sqrt{6}}{3})$ the rotation matrix is
$$ R = \begin{pmatrix} 1&0&0\\0&1&0\\0&0&1\end{pmatrix} +\begin{pmatrix} 0&\frac{\sqrt{6}}{3}&0\\ \text{-}\frac{\sqrt{6}}{3}&0&\frac{\sqrt{3}}{3}\\0&\frac{\sqrt{3}}{3}&0\end{pmatrix} \sin\theta + \begin{pmatrix} \text{-}\frac{2}{3}&0&\frac{\sqrt{2}}{3}\\0&\text{-}1&0\\\text{-}\frac{\sqrt{2}}{3}&0&\text{-}\frac{1}{3}\end{pmatrix} (1-\cos\theta) $$
which collects to:
$$  R = \frac{1}{3} \begin{pmatrix} 1\cos\theta+1 & \sqrt{6}\sin\theta & \sqrt{2}\cos\theta-\sqrt{2} \\ -\sqrt{6}\sin\theta& 3 \cos\theta & -\sqrt{3}\sin\theta \\ \sqrt{2}\cos\theta - \sqrt{2} & \sqrt{3}\sin\theta& \cos\theta+2 \end{pmatrix} $$
A: Suppose $|u|=1$ and $C(u)x=u\times x$, that is
$$
C(u)=\begin{bmatrix}0&-u_3&u_2\\u_3&0&-u_1\\-u_2&u_1&0\end{bmatrix}
$$
Then, for the rotation matrix $R(u,\theta)$, we have
$$
\frac{\mathrm{d}}{\mathrm{d}\theta}R(u,\theta)x=C(u)R(u,\theta)x
$$
That is, the direction of motion of rotation is perpendicular to the axis of rotation and the position of the point rotated.
Thus,
$$
R(u,\theta)=e^{\theta C(u)}
$$
One property of the cross product matrix, $C(u)$, is that
$$
C(u)^3=-C(u)
$$
which aids in computing the exponential via power series:
$$
R(u,\theta)=e^{\theta C(u)}=I+C(u)\sin(\theta)+C(u)^2(1-\cos(\theta))
$$
where
$$
C(u)=\begin{bmatrix}0&-u_3&u_2\\u_3&0&-u_1\\-u_2&u_1&0\end{bmatrix}\quad\text{and}\quad
C(u)^2=\begin{bmatrix}u_1^2-1&u_1u_2&u_1u_3\\u_1u_2&u_2^2-1&u_2u_3\\u_1u_3&u_2u_3&u_3^2-1\end{bmatrix}
$$
