and is the cross-product matrix. This expands to: Rotation matrix ↔ quaternion When computing a quaternion from the rotation matrix there is a sign ambiguity, since and represent the same rotation. One way of computing the quaternion from the rotation matrix is as follows: There are three other mathematically equivalent ways to compute . Numerical inaccuracy can be reduced by avoiding situations in which the denominator is close to zero. One of the other three methods looks as follows: The rotation matrix corresponding to the quaternion can be computed as follows: where which gives or equivalently Euler angles ↔ quaternion Euler angles ( extrinsic) → quaternion We will consider the -convention 3-1-3 extrinsic Euler angles for the following algorithm. The terms of the algorithm depend on the convention used. We can compute the quaternion from the Euler angles as follows: Euler angles ( intrinsic) → quaternion A quaternion equivalent to yaw (), pitch () and roll () angles. or intrinsic Tait–Bryan angles following the convention, can be computed by Quaternion → Euler angles ( extrinsic) Given the rotation quaternion the -convention 3-1-3 extrinsic Euler Angles can be computed by Quaternion → Euler angles ( intrinsic) Given the rotation quaternion yaw, pitch and roll angles, or intrinsic Tait–Bryan angles following the convention, can be computed by Euler axis–angle ↔ quaternion Given the Euler axis and angle , the quaternion can be computed by Given the rotation quaternion , define Then the Euler axis and angle can be computed by Rotation matrix ↔ Rodrigues vector Rodrigues vector → Rotation matrix Since the definition of the Rodrigues vector can be related to rotation quaternions:By making use of the following propertyThe formula can be obtained by factoring from the final expression obtained for quaternions: Leading to the final formula: Conversion formulae for derivatives Rotation matrix ↔ angular velocities The angular velocity vector can be extracted from the time derivative of the rotation matrix by the following relation: The derivation is adapted from Ioffe as follows: For any vector , consider and differentiate it: The derivative of a vector is the linear velocity of its tip. Since is a rotation matrix, by definition the length of is always equal to the length of , and hence it does not change with time. Thus, when rotates, its tip moves along a circle, and the linear velocity of its tip is tangential to the circle; i.e., always