Calculate angle of rotation induced by a matrix without resorting to rotation matrix

5.2k Views Asked by At

Given a matrix, say

$$\begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix}$$

We can squint our eyes and say that is similar to a rotation matrix

$$\begin{bmatrix} \cos(45) & -\sin(45) \\ \sin(45) & \cos(45) \end{bmatrix}$$

What is a more direct, general way to calculate the angle that the matrix induces on say the standard axis $([1, 0], [0, 1])$?

2

There are 2 best solutions below

2
On BEST ANSWER

In the general case, you'll have two angles, one for each axis.

The columns of the matrix are the images of the basis vectors. The rotation angles can be found via dot product:

For $$ A=\pmatrix {u_x & v_x \\ u_y & v_y } $$ we’d have $$ \cos\theta_x=\frac {\mathbf e_x\cdot \mathbf u}{||\mathbf u||}=\frac{u_x}{\sqrt{u_x^2+u_y^2}} $$ and $$ \cos\theta_y=\frac {\mathbf e_y\cdot \mathbf v}{||\mathbf v||}=\frac{v_y}{\sqrt{v_x^2+v_y^2}} $$ This also gives you a way to tell if the matrix is a “rotation.”

0
On

A rotation matrix needs to have determinant 1. This is a matrix formulation of the famous $$\sin(x)^2 + \cos(x)^2 = 1$$ The other requirement is that it needs to be orthogonal $${\bf R}^{-1} = {\bf R}^T$$ It's matrix logarithm will be well defined and equal to the angle of rotation, for example:

$${\bf R} = \left[\begin{array}{cc} -0.678597&-0.734510\\ 0.734510&-0.678597 \end{array}\right]$$

$$\log({\bf R}) = \left[\begin{array}{cc} 0&-2.316647\\ 2.316647&0\end{array}\right]$$

So it will (also) be anti-symmetric, but notice the $0$ diagonal. If we investigate this a bit more, we find that $\cos(2.3\cdots) = -0.6786$ which we will find at the top left position in the rotation matrix. This is not surprising if we are aware of the real matrix representation of complex numbers, where the complex number $a+bi$ can be represented as $$\left[\begin{array}{rr} a&-b\\ b&a\end{array}\right]$$ Multiplication on the unit circle corresponds to a rotation and the matrix logarithm of this matrix corresponds to the exponent in the complex polar form $re^{\varphi i}$