|
|
|
|
|
by jacobolus
3406 days ago
|
|
In the three-dimensional case, for any practical purpose, use quaternions. https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotati... (At least if you’re ever needing to compose rotations; to apply a quaternion to a big array of 3-vectors, go ahead and convert it to a 3x3 matrix first, which should end up slightly more efficient.) 3x3 rotation matrices are really hard to keep normalized properly, whereas quaternions are trivial to normalize (just divide by the norm). If you need to compress a unit quaternion down to 3 numbers, instead of taking the logarithm (which is computationally expensive and a pain to deal with) use the stereographic projection. |
|
Imaginary numbers can be represented with a 2x2 skew symmetric matrix with no stretch of the imagination at all. And 3x3 skew symmetric matrixes represent rotations most compactly with only 3 actual variables. Instead of 4 for quaternions, 9 for "classic rotation matrixes", or the need to tell which is the order of the angles if you're given 3 euler angles.
There are interesting applications of Lie Algebra on SO(3) [1], notably in computer vision where a global energy is minimized across two successive rgb-d "shots" in order to recover the infinitesimal rotation [2]. It's going to be easier to minimize energy on something that is most compactly defined, and always amounts to a valid rotation.
[1] https://en.wikipedia.org/wiki/Rotation_group_SO(3)#Lie_algeb... [2] https://vision.in.tum.de/_media/spezial/bib/kerl13icra.pdf