[Math] Calculate angle of rotation induced by a matrix without resorting to rotation matrix

linear algebramatricesrotations

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])$?

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.”