# Angular error (in Euler angles) through quaternions

I found this formula in some notes but I would like to have a reference (book, paper, etc.) to understand where it comes from. I know that it works only for small angles.

$$\begin{bmatrix} \phi_e\\ \theta_e\\ \psi_e \end{bmatrix} = sgn(q_e^0) \cdot \begin{bmatrix} 2q_e^1\\ 2q_e^2\\ 2q_e^3 \end{bmatrix}$$

• $$q_c$$ is the quaternion setpoint
• $$q$$ is the current quaternion (the one we are "measuring")
• $$q_e=q_c \otimes q^{-1}$$ is the error in the orientation
• While $$\begin{bmatrix}\phi_e\\ \theta_e\\ \psi_e \end{bmatrix}$$ is a vector of error in roll, pitch, and yaw angles.