Rotation matrix about an arbitrary axis

In summary: The matrix you want isR= A^{-1}B^{-1}\begin{bmatrix} cos(\theta) & - sin(\theta) & 0 \\ sin(\theta) & cos(\theta) & 0 \\ 0 & 0 & 1 \end{bmatrix}BA= \begin{bmatrix} \frac{a^2+ b^2}{a^2+ b^2+ c^2} & -\frac{ab}{a^2+ b^2+ c^2} & -\frac{ac}{a^2+ b^2+ c^2} \\ -\frac{ab}{a^2+ b^2+ c^2
  • #1
Happiness
679
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
  • #2
Thanks for reading! The mistake has been found. ##T_2##'s entries are wrong.
 
  • #3
Here is how I would do this, in general, to find the matrix that rotates a vector through angle [itex]\theta[/itex] about axis <a, b, c>. (I will assume that <a, b, c> has length 1: [itex]\sqrt{a^2+ b^2+ c^2}= 1[/itex].)

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 [itex]r= \sqrt{a^2+ b^2}[/itex]. I presume you know that, in two dimensions, the matrix rotating thorough angle [itex]\theta[/itex] is given by
[tex]\begin{bmatrix}cos(\theta) & - sin(\theta) \\ sin(\theta) & cos(\theta) \end{bmatrix}[/tex].

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

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

That is, this matrix is
[tex]A= \begin{bmatrix}\frac{b}{r} & -\frac{a}{r} & 0 \\ \frac{a}{r} & \frac{b}{r} & 0 \\ 0 & 0 & 1\end{bmatrix}[/tex].

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
[tex]\begin{bmatrix}1 & 0 & 0 \\ 0 & \alpha & -beta \\ 0 & \beta & \alpha \end{bmatrix}\begin{bmatrix} 0 & r & c \end{bmatrix}= \begin{bmatrix} 0 \\ r\alpha- c\beta \\ r\beta+ c\alpha \end{bmatrix}= \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}[/tex].

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

That is, this is the matrix
[tex]B= \begin{bmatrix}1 & 0 & 0 \\ 0 & c & -r \\ 0 & r & 1\end {bmatrix}[/tex]

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

What is a rotation matrix about an arbitrary axis?

A rotation matrix about an arbitrary axis is a mathematical tool used to rotate a vector or a point in 3-dimensional space around an arbitrary axis by a given angle. It is represented by a 3x3 matrix and is used in various fields such as graphics, robotics, and physics.

How is a rotation matrix about an arbitrary axis different from a rotation matrix about a fixed axis?

A rotation matrix about a fixed axis only allows rotation around that specific axis, while a rotation matrix about an arbitrary axis can rotate around any axis in 3-dimensional space. It is more flexible and can be used to rotate objects in any direction.

How is a rotation matrix about an arbitrary axis calculated?

A rotation matrix about an arbitrary axis is calculated using a combination of trigonometric functions such as sine and cosine. The axis of rotation must be normalized, and the angle of rotation must be in radians. The final matrix is created by combining the rotation matrices for each axis of the coordinate system.

What is the purpose of using a rotation matrix about an arbitrary axis?

A rotation matrix about an arbitrary axis is used to rotate objects or points in 3-dimensional space. It is particularly useful in computer graphics, where it is used to achieve smooth rotations of objects, and in robotics, where it is used to control the movement of robotic arms.

How does a rotation matrix about an arbitrary axis affect the coordinates of a point or vector?

A rotation matrix about an arbitrary axis changes the coordinates of a point or vector by rotating them around the given axis by the specified angle. The final coordinates of the point or vector will be different from the original coordinates, depending on the angle and the axis of rotation.

Similar threads

  • Advanced Physics Homework Help
Replies
8
Views
738
Replies
2
Views
1K
Replies
13
Views
3K
  • Calculus and Beyond Homework Help
Replies
6
Views
300
  • Calculus and Beyond Homework Help
Replies
2
Views
92
  • General Math
Replies
5
Views
2K
  • Linear and Abstract Algebra
Replies
6
Views
522
Replies
2
Views
417
  • Linear and Abstract Algebra
Replies
16
Views
1K
Replies
31
Views
2K
Back
Top