If I understand correctly there are multiple ways of approaching rotations in space. On approach is the rotation matrix which is defined as:
$$ R = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} $$
Another approach is are using euler angles and defined axes: $ \alpha, \beta, \gamma $
The third approach (and for me a bit more obscure) is quaternions. A rotation of angle $\theta$ around the axis defined by the unit vector $ \vec{u} = (u_x, u_y, u_z) = u_x\mathbf{i} + u_y\mathbf{j} + u_z\mathbf{k}$ can be represented by a quaternion. This can be done using:
$$ \mathbf{q} = e^{\frac{\theta}{2}{(u_x\mathbf{i} + u_y\mathbf{j} + u_z\mathbf{k})}} = \cos \frac{\theta}{2} + (u_x\mathbf{i} + u_y\mathbf{j} + u_z\mathbf{k}) \sin \frac{\theta}{2}$$
Are they exactly "mathematically" equivalent? It seems that an algebraic concept like quaternions that can represent rotations must be the best. Also it seems kind of coincidental that these objects can describe rotations that well. Apparantly it also doesn't give problems like a 'gimbal lock'.
The reason I am asking is because I am trying to write a python script in understanding mechanical motions better.