# How to find the rotation angle and axis of rotation of linear transformation?

I need some help with this problem:

We know that $$T(x_1,x_2,x_3)=(x_2,x_3,x_1)$$. We suspect that it is a rotation matrix, to be sure, we need to determine the rotation axis and the rotation angle.

I first tried to see what the linear transformation did to the basis vectors. $$T(1,0,0)=(0,0,1)$$ $$T(0,1,0)=(1,0,0)$$ $$T(0,0,1)=(0,1,0)$$ With this informatio, I wrote the matrix that represents the linear transformation: $$A=\left[\begin{matrix} 0&1&0\\0&0&1\\1&0&0 \end{matrix}\right]$$ After that, I don't know how to determine the angle and the axis, can you help me?

A vector on the axis of the rotation matrix $$A$$ will satisfy $$Av=v$$, that is $$(A-I)v=0$$. In this example, $$A-I=\pmatrix{-1&1&0\\0&-1&1\\1&0&-1}.$$ and $$(A-I)\pmatrix{x\\y\\z}=\pmatrix{0\\0\\0}$$ iff $$x=y=z$$, so the axis is the line joining the origin to $$(1,1,1)$$.

In this example, $$A^3=I$$, so the angle of rotation is a third of a turn: $$\frac{2\pi}3$$.

More generally if $$\theta$$ is the rotation angle of a rotation matrix $$A$$, then the trace of $$A$$ is $$1+2\cos\theta$$, so the angle can easily be found from this.

• Can you explain where $A-I$ comes from? – davidllerenav Apr 9 at 6:46
• @davidllerenav It's a special case of the usual trick for finding eigenvectors. For a rotation matrix, the axis of the rotations is the set of eigenvectors for the eigenvalue $1$. – Lord Shark the Unknown Apr 9 at 8:16
• Well, I haven't seen eigenvectors and eigenvalues on class yet. – davidllerenav Apr 9 at 17:57
• @LordSharktheUnknown To use eigenvalues is good for the determination only the line, but axis for 3D rotations has also a direction. How could you discern in the approach with eigenvalues what vector $v$ is better for representing axis: $[1 \ \ 1 \ \ 1]$ or $[-1 \ \ -1\ \ -1]$ ? ... $(R(v,\theta) \ne R(-v,\theta)$ – Widawensen Apr 12 at 6:08

Let me try it in a simple way. First determine it is a rotation matrix or not. To be a rotation matrix the matrix should be orthogonal and the determinant of the matrix should be +1 (if it is orthogonal and determinant is -1, then it is not a rotation matrix). And for this matrix $$\begin{bmatrix} 0&1&0\\0&0&1\\1&0&0 \end{bmatrix}$$ we can easily confirm it is orthogonal and determinant is +1.

It is probably clear that a vector on the axis of the rotation matrix A will not change direction (as it is on the axis of rotation) (as mentioned by Lord Shark the Unknown), So treating this vector as $$(x,y,z)$$, we see that

$$\begin{bmatrix} 0&1&0\\0&0&1\\1&0&0 \end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix} = \begin{bmatrix}x\\y\\z\end{bmatrix}$$

Now we solve these linear equations.

The first equation gives $$0.x+1.y+0.z = x$$, so $$y=x$$

The second equation gives $$0.x+0.y+1.z = y$$, so $$z=y$$

The third equation gives $$1.x+0.y+0.z = z$$, so $$x=z$$

That gives the axis of rotation x=y=z, you can take this as along the line of vector (1,1,1) or (-1,-1,-1).

Now regarding the angle of rotation it may be little complex.The angle of rotation in this case is the rotation of the plane which is perpendicular to rotation axis. To find out the magnitude and the direction we need to see a vector on this plane, how much it was rotated and in which direction. Now the direction is relative, based on from which side of the plane you are looking at.

From x=y=z, we can form vector (1,1,1), (-1,-1,-1), Now any vector (x,y,z) perpendicular to these vector will lie on the plane perpendicular to these vector. To find out arbitrarily we set the dot product to zero i.e.

$$x.1+y.1+z.1=0$$ or $$z=-x-y$$, we also get from condition of rotation the new vector will be (y,z,x) . So putting arbitrarily values for x,y we get vector A (1,2,-3), and after rotation vector B(2,-3,1). Let us again use the dot product to find out the angle between these vectors

$$AB\cos\theta = 2-6-3$$ or , $$\sqrt{14}\sqrt{14}\cos\theta = -7$$, or $$\cos\theta =-1/2$$ and we get $$\theta =\pm 2\dfrac{\pi}{3}$$. Obviously $$\theta$$ can be both positive and negative based on from which side we are looking at the plane.

To figure out this we use cross product. Let the cross product (the vector) is C. We find out its component,

$$\begin{bmatrix}1&2&-3\\2&-3&1\\i&j&k\end{bmatrix}$$

$$C_x =\begin{bmatrix}2&-3\\-3&1\end{bmatrix} = -7$$, $$C_y =-\begin{bmatrix}1&-3\\2&1\end{bmatrix} = -7$$, $$C_z =\begin{bmatrix}1&2\\2&-3\end{bmatrix} = -7$$,

So C(-7,-7,-7), we find out angle from the relation $$C=AB\sin\theta$$ or, $$7\sqrt{3}=\sqrt{14}\sqrt{14}\sin\theta$$, $$\sin\theta = \dfrac{\sqrt{3}}{2}$$

so $$\theta = \dfrac{\pi}{3}, 2\dfrac{\pi}{3}$$

Now what we found out from cross product is that looking at the plane from cross product C(-7,-7,-7), vector B is in the positive direction of, i.e. anticlockwise from vector A by positive angles $$\dfrac{\pi}{3}, 2\dfrac{\pi}{3}$$ (to get the same cross product, these two different angles are possible).

Comparing this with the result of dot product we see that the required angle is $$+2\dfrac{\pi}{3}$$, Now this angle, what we see is from the side of C(-7,-7,-7) or, (-1,-1,-1).