Computing Euler angles from a rotation matrix