Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question

migrated from Dec 11 '12 at 10:18

This question came from our site for active researchers, academics and students of physics.

See e.g. Wikipedia – Qmechanic Dec 9 '12 at 8:40
But the Wikipedia page just tells the formula . I want to know how to derive this – vbvbcxv Dec 9 '12 at 8:41
It's just a conjugation of the simple matrix for a rotation around the $z$-axis, which is effectively just 2 x 2 matrix, by another rotational matrix that rotates the North pole to the point $V$, which is a product of rotation in the theta-direction and the phi-direction to get where you need to get. Conjugation by $U$ is $URU^{-1}$ where the product is matrix product. It's possible ineffective to write these things without matrices so if you don't know matrices, this is a reason to learn them. At any rate, it's not really physics, it's linear algebra and geometry and a basic one. – Luboš Motl Dec 9 '12 at 9:15
thanks a lot. It's pretty simple . I think it can also be solved by considering an arbitrary vector ,taking the projection of that vector into the plane perpendicular to the axis of rotation and rotate that vector . – vbvbcxv Dec 9 '12 at 11:05
This is a math question and belongs on Mathematics – Sklivvz Dec 9 '12 at 14:17

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} $$

share|cite|improve this answer
Noting that $C(u)^2=uu^T-I$, Rodrigue's formula is the same as $R(u,\theta)$ in my answer. However, on MSE, it is preferable to answer with more than a link. Consider adding a bit of what Rodrigue's rotation matrix composition says, if not a proof. – robjohn Dec 11 '12 at 15:34
Thanks for the pointer, and since my answer was first hopefully it will get accepted. – ja72 Dec 11 '12 at 20:20
Thanks for completing the answer. (+1) Unfortunately, there is no author for this question on math.SE, so no answer will be accepted unless the author registers on physics.SE and associates their account on math.SE. – robjohn Dec 11 '12 at 20:27
Yeah hand typing 5 3x3 matrices in $LaTeX$ is painful, but I agree, also necessary for a complete answer. – ja72 Dec 11 '12 at 20:31
I have asked the author from physics.SE to register there and join here so that they can get reputation and so that they can accept here, too. – robjohn Dec 12 '12 at 1:00

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} $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.