I know why Euler angles suffer from gimbal lock (with the help of a physical gimbal/gyro model), but I read from various sources (1,2) that rotation matrices do not. Aren't rotation matrices constructed from Euler angles? What makes them immune?
(As a bonus: what would you recommend as a comprehensive guide to understanding 3D rotations? I find this topic quite confusing, and the myriad of convention differences only makes it more so.)
Thank you.
Because rotation matricies are not really about rotation, but change of basis.... a very specific change of basis which preserves orthogonality, length and handedness (i.e. $SO(3)$). In this very special case such a change of basis can be thought of as a rotation. If we think about the 9 elements in a rotation matrix under the constraints of orthogonality, length preservation and handedness, there are really only 3 degrees of freedom. These may be abstractly though of as a position on a sphere and an angle. It is because any parameterization of the sphere always has two singularities (i.e. you loose one degree of freedom (e.g. the N and S pole for lat-long parameterization) ) that the phenomenon of gimbal lock happens. It is a fundamental property of the underlying geometry. If the sphere is parameterized with three parameters, this issue goes away (i.e. axis-angle, quaternions).
So the real questions is why doesn't gimbal lock occur with four parameters? It is becuse the sphere can be parameterized with three parameters and not be subject to singularities.