Another connection to make: quaternions can be represented as a Lie group, which is a (smooth differentiable) manifold. This means representing 3d orientation using quaternions works better for optimization than e.g Euler angles (roll, pitch, heading) in things like SLAM.
What do you mean “works better”? Symbolically simpler once you know the requisite math behind Lie groups? In terms if computation, why would one representation be any different than the other? Unless you mean there’s a subset of certain computations where that representation is better but also a subset where it is worse? Similar to how there are cases where a Hough transform allows a more efficient calculation, but m…
Besides the gimbal lock problem mentioned in another problem, Euler angles are not easy to compose. It is also not obvious how to calculate the misorientation between two rotations with Euler angles, but it is trivial with quaternions.
Other approaches have their own problems. For example, matrices are more expensive to use in a computer (normalizing a quaternion to avoid rounding errors is much faster than normalizing the equivalent matrix, and quaternions need less memory), and Rodrigues vectors, while usually very useful, present the problem of infinite values for rotations of 180 degrees (which, in my opinion, should not be a problem, but it is in many programming languages).
At the end of the day, quaternions present the best compromise.