qops.rotmat2quat()#

RotationalDiffusion.quaternions.rotmat2quat(rotmats)[source]#

Convert 3D rotation matrices to their quaternion representation.

Implementation of the Bar-Itzhack algorithm,[1][2] which determines the optimal unit quaternion corresponding to the orthogonal rotation matrix closest to the input matrix.

Parameters:
rotmats(…, 3, 3) array_like

Rotation matrices to be converted to quaternions.

Returns:
quats(…, 4) ndarray

Quaternions.

References