Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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

I was told that you can rotate a vector about a given axis in Cartesian space by combining rotations about the other two axes. I found a quick method for 90 degree rotations but I'm unsure how to generalise it for arbitrary angles?

The method for 90 degree rotations: e.g. you want to rotate a vector by 90 deg about the y-axis, then you rotate 90 deg about z-axis, 90 deg about the x-axis and then -90 deg about the z-axis.

share|cite|improve this question
The 90 and -90 rotations around the z-axis in your example are bringing the y-axis in line with the x-axis, so just change the angle you rotate about x-axis to be whatever you wanted the angle to rotate around the y-axis to have been. – Shard Jan 20 '13 at 14:39
This seemed to do the trick. Thanks @Shard ! – User 17670 Jan 20 '13 at 15:00

In order to rotate by $\theta$ around some axis denoted by $\hat{u}=[u_{x},u_{y},u_{z}]$ you can construct the following $3\times3$ matrix, where $c_{\theta}=\cos{\theta}$ and $s_{\theta}=\sin{\theta}$:

$$\mathbf{R}_{\hat{u}}\triangleq\begin{bmatrix}c_{\theta}+u_{x}^{2}(1-c_{\theta}) & u_{x}u_{y}(1-c_{\theta})+u_{z}s_{\theta} & u_{x}u_{z}(1-c_{\theta})-u_{y}s_{\theta} \\ u_{x}u_{y}(1-c_{\theta})-u_{z}s_{\theta} & c_{\theta}+u_{y}^{2}(1-c_{\theta}) & u_{y}u_{z}(1-c_{\theta})+u_{x}s_{\theta} \\ u_{x}u_{z}(1-c_{\theta})+u_{y}s_{\theta} & u_{y}u_{z}(1-c_{\theta})-u_{x}s_{\theta} & c_{\theta}+u_{z}^{2}(1-c_{\theta})\end{bmatrix}$$

share|cite|improve this answer
+1 What a nice result! – Babak S. Jan 20 '13 at 14:43
While it is a very nice result, I'm not sure it actually answers the question in that the matrix $\bf{R_{\hat{u}}}$ would appear difficult to decompose. – User 17670 Jan 20 '13 at 14:59

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.