{'fraction_non_alphanumeric': 0.019543973941368076, 'fraction_numerical': 0.004560260586319218, 'mean_word_length': 5.426778242677824, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Survey on the Computation of Quaternions From Rotation Matrices

The parameterization of rotations is a central topic in many theoretical and applied fields such as rigid body mechanics, multibody dynamics, robotics, spacecraft attitude dynamics, navigation, three-dimensional image processing, and computer graphics. Nowadays, the main alternative to the use of rotation matrices, to represent rotations in ℝ3, is the use of Euler parameters arranged in quaternion form. Whereas the passage from a set of Euler parameters to the corresponding rotation matrix is unique and straightforward, the passage from a rotation matrix to its corresponding Euler parameters has been revealed to be somewhat tricky if numerical aspects are considered. Since the map from quaternions to 3 × 3 rotation matrices is a 2-to-1 covering map, this map cannot be smoothly inverted. As a consequence, it is erroneously assumed that all inversions should necessarily contain singularities that arise in the form of quotients where the divisor can be arbitrarily small. This misconception is herein clarified. This paper reviews the most representative methods available in the literature, including a comparative analysis of their computational costs and error performances. The presented analysis leads to the conclusion that Cayley's factorization, a little-known method used to compute the double quaternion representation of rotations in four dimensions from 4 × 4 rotation matrices, is the most robust method when particularized to three dimensions.