Q:

Going From a Matrix to Eulers When Cosine is 0

Given a rotation matrix created from the Eulers $\phi$, $\theta$, $\psi$ like this which I want to take back to Eulers:
$$
\begin{bmatrix}
    \cos\theta\cos\psi & -\cos\theta\sin\psi & \sin\theta \\
    \sin\phi\sin\theta\cos\psi + \cos\phi\sin\psi & -\sin\phi\sin\theta\sin\psi + \cos\phi\cos\psi & -\sin\phi\cos\theta \\
    -\cos\phi\sin\theta\cos\psi + \sin\phi\sin\psi & \cos\phi\sin\theta\sin\psi + \sin\phi\cos\psi & \cos\phi\cos\theta
\end{bmatrix}
$$
I can easily get $\theta$ from the top right component. But what happens when the top right is 1 or negative 1? That means that the rest of the top row and top column will go to 0. In the instance of 1, taking my matrix to:
$$
\begin{bmatrix}
    0 & 0 & 1 \\
    \sin\phi\cos\psi + \cos\phi\sin\psi & -\sin\phi\sin\psi + \cos\phi\cos\psi & 0 \\
    -\cos\phi\cos\psi + \sin\phi\sin\psi & \cos\phi\sin\psi + \sin\phi\cos\psi & 0
\end{bmatrix}
$$
I know that I can use the sum and difference formulas to reduce this to:
$$
\begin{bmatrix}
    0 & 0 & 1 \\
    \sin(\phi +\psi) & \cos(\phi + \psi) & 0 \\
    -\cos(\phi + \psi) & \sin(\phi + \psi) & 0
\end{bmatrix}
$$
I've read here in section 2.1 that this is indeterminate but that:
$$ \phi + \psi = \tan^{-1}(\sin(\phi +\psi) / \cos(\phi + \psi)) $$
I'm having trouble making that step. How did they go from that last matrix to the equality?

A:

The last step follows from the definition of the tangent : 
$$\tan \theta = \frac{\sin \theta}{\cos \theta}$$

