Rotation matrix about an arbitrary axis

Click For Summary
SUMMARY

The discussion focuses on deriving the rotation matrix R for a vector v rotated anticlockwise by an angle of -120° about an arbitrary axis defined by the vector p = (1, 1, 1). The transformations involved include T1, T2, and T3, which represent rotations in different coordinate systems. The final rotation matrix R was initially calculated incorrectly but was later corrected to R = (0, 1, 0; 0, 0, 1; 1, 0, 0). The correct approach emphasizes the need to accurately compute the transformation matrices and their inverses to achieve the desired rotation.

PREREQUISITES
  • Understanding of rotation matrices in 3D space
  • Familiarity with coordinate transformations
  • Knowledge of trigonometric functions and their applications in matrix operations
  • Experience with linear algebra concepts, particularly eigenvalues and eigenvectors
NEXT STEPS
  • Study the derivation of the Rodrigues' rotation formula for rotating vectors in 3D
  • Learn about quaternion representation for 3D rotations
  • Explore the application of rotation matrices in computer graphics
  • Investigate the implications of rotation matrices on rigid body dynamics
USEFUL FOR

This discussion is beneficial for mathematicians, computer graphics developers, and engineers working with 3D modeling, simulations, or robotics, who require a solid understanding of rotation transformations in three-dimensional space.

Happiness
Messages
686
Reaction score
30
Suppose a position vector v is rotated anticlockwise at an angle ##\theta## about an arbitrary axis pointing in the direction of a position vector p, what is the rotation matrix R such that Rv gives the position vector after the rotation?

Suppose p = ##\begin{pmatrix}1\\1\\1\end{pmatrix}## and ##\theta## = -120##^\circ##.

My approach is as follows.

First, perform transformation ##T_1##: rotate the xy plane 45##^\circ## anticlockwise about the z axis. (I treat this as keeping v fixed but expressing v in terms of the new coordinate system CS1.)

Next, perform transformation ##T_2##: rotate the xz plane ##\tan^{-1}\frac{1}{\sqrt2}## clockwise about the y-axis (clockwise when the y-axis points into your eye) so that the x-axis is now pointing in the direction of p. (Again, I treat this as keeping v fixed but expressing v in terms of the new coordinate system CS2.)

Then, perform transformation ##T_3##: rotate the yz plane 120##^\circ## anticlockwise about the x axis, since rotating v by -120##^\circ## has the same effect as rotating the yz plane 120##^\circ## (turning the coordinate system about the rotation axis by 120##^\circ## while keeping v fixed).

We have ##T_1=\begin{pmatrix}\frac{1}{\sqrt2}&\frac{1}{\sqrt2}&0\\-\frac{1}{\sqrt2}&\frac{1}{\sqrt2}&0\\0&0&1\end{pmatrix}## , ##T_2=\begin{pmatrix}\frac{\sqrt2}{\sqrt3}&0&-\frac{1}{\sqrt3}\\0&1&0\\\frac{1}{\sqrt3}&0&\frac{\sqrt2}{\sqrt3}\end{pmatrix}## , ##T_3=\begin{pmatrix}1&0&0\\0&-\frac{1}{2}&\frac{\sqrt3}{2}\\0&-\frac{\sqrt3}{2}&-\frac{1}{2}\end{pmatrix}##

Next, perform the inverse of transformation ##T_2##. (Changing the expression of v from coordinate system CS2 back to CS1.)

Lastly, perform the inverse of transformation ##T_1##. (Changing the expression of v from coordinate system CS1 back to CS0, the original coordinate system.)

Thus, R = ##T_1^{-1}T_2^{-1}T_3T_2T_1 = \begin{pmatrix}0&0&-1\\1&0&0\\0&-1&0\end{pmatrix}##

But R should be ##\begin{pmatrix}0&1&0\\0&0&1\\1&0&0\end{pmatrix}## since rotating v about p by -120##^\circ## has the effect of turning the x-axis to the y axis, and the y-axis to the z axis, and the z axis to the x-axis (turning the coordinate system about the rotation axis p by 120##^\circ## while keeping v fixed).

Why do I get different answers? What's wrong with my approach?
 
Last edited:
Physics news on Phys.org
Thanks for reading! The mistake has been found. ##T_2##'s entries are wrong.
 
Here is how I would do this, in general, to find the matrix that rotates a vector through angle \theta about axis <a, b, c>. (I will assume that <a, b, c> has length 1: \sqrt{a^2+ b^2+ c^2}= 1.)

First, find the matrix that rotates < a, b, c> into < 0, 0, 1>. To do that, first find the matrix, A, that rotates, around the z-axis, mapping <a, b c> to <0, r, c> where r= \sqrt{a^2+ b^2}. I presume you know that, in two dimensions, the matrix rotating thorough angle \theta is given by
\begin{bmatrix}cos(\theta) &amp; - sin(\theta) \\ sin(\theta) &amp; cos(\theta) \end{bmatrix}.

So we can write a rotating about the z-axis, as
\begin{bmatrix}\alpha &amp; \ -beta &amp; 0 \\ \beta &amp; \alpha &amp; 0 \\ 0 &amp; 0 &amp; 1\end{bmatrix}
so that such a matrix mapping <a, b, c> to < 0, r, c> must give
\begin{bmatrix}\alpha &amp; \ -beta &amp; 0 \\ \beta &amp; \alpha &amp; 0 \\ 0 &amp; 0 &amp; 1\end{bmatrix}\begin{bmatrix}a \\ b \\ c\end{bmatrix}= \begin{bmatrix}a\alpha- b\beta \\ a\beta+ b\alpha \\ c\end{bmatrix}= \begin{bmatrix} 0 // r // z\end{bmatrix}
That gives the two equations a\alpha- b\beta= 0, a\beta+ b\alpha= r.

If we multiply the first of those equations by a, to get a^2\alpha- ab\beta= 0, multiply the second equation by b, to get b^2\alpha+ ab\beta= br, then add the two equations, we eliminate b getting (a^2+ b^2)\alpha= br so that \alpha= \frac{br}{a^2+ b^2}= \frac{b}{r} since r= \sqrt{a^2+ b^2}. Putting that into a^2\alpha- ab\beta= 0 we get ab\beta= a^2\alpha= \frac{a^2}{r} so that \beta= \frac{a}{r}.

That is, this matrix is
A= \begin{bmatrix}\frac{b}{r} &amp; -\frac{a}{r} &amp; 0 \\ \frac{a}{r} &amp; \frac{b}{r} &amp; 0 \\ 0 &amp; 0 &amp; 1\end{bmatrix}.

Now we want to find the matrix, B, that rotates, around the x-axis, mapping < 0, r, c> to < 0, 0 , 1>. We can write that as
\begin{bmatrix}1 &amp; 0 &amp; 0 \\ 0 &amp; \alpha &amp; -beta \\ 0 &amp; \beta &amp; \alpha \end{bmatrix}\begin{bmatrix} 0 &amp; r &amp; c \end{bmatrix}= \begin{bmatrix} 0 \\ r\alpha- c\beta \\ r\beta+ c\alpha \end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}.

So we have the two equations r\alpha- c \beta= 0 and c\alpha+ r\beta= 1. Multiply the first equation by r, to get r^2\alpha- rc\beta= 0, multiply the second equation by c to get c^2\alpha + rc\beta= c, then add, eliminating \beta and getting (r^2+ c^2)\alpha= c so that \alpha= \frac{c}{r^2+ c^2}= c since \sqrt{r ^2+ c^2}= \sqrt{a^2+ b^2+ c^2}= 1. Putting that into r\alpha- c\beta= 0 we have \beta= \frac{r}{c}(c)= r.

That is, this is the matrix
B= \begin{bmatrix}1 &amp; 0 &amp; 0 \\ 0 &amp; c &amp; -r \\ 0 &amp; r &amp; 1\end {bmatrix}

Now, to rotate a vector through angle \theta about the vector <a, b, c>, multiply by A and B to rotate <a, b, c> into <0, 0, 1> then rotate through angle \theta around the z-axis, then multiply by B^{-1} and A^{-1} to return to the original axis of rotation.
 
Last edited by a moderator:

Similar threads

  • · Replies 21 ·
Replies
21
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
31
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K