Rotation matrix about an arbitrary axis

Click For Summary
The discussion focuses on finding the rotation matrix R that rotates a position vector v anticlockwise by an angle of -120° about an arbitrary axis defined by the vector p = (1, 1, 1). The initial approach involves a series of transformations (T1, T2, T3) to express v in different coordinate systems, but a mistake in the entries of T2 leads to an incorrect final matrix. The correct rotation matrix R should reflect the transformation of the coordinate axes as specified, ultimately resulting in R = (0, 1, 0; 0, 0, 1; 1, 0, 0). The discussion concludes with a more general method for constructing rotation matrices about any arbitrary axis, emphasizing the need for careful calculations in each transformation step.
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:
Mathematics 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:
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
31
Views
3K