I need to get the axis angle from a matrix of the form:
$ \begin{matrix} \cos \theta & -\sin \theta & tx\\ \sin \theta & \cos \theta & ty\\ 0 & 0 & 1\\ \end{matrix} $
Into an axis angle. I've tried the standard formula:
$\theta$ = $\arccos$ ( (m[0][0] + m[1][1] + m[2][2] - 1) / 2 )
However this formula inverts when the angle reaches PI. For example, given a rotational matrix for an angle of 225 degrees, we get a returned value of about 135 degrees, which in itself is perfectly correct, but I really need the full value.
Is there any way of handling these cases?