rotmat2quat# torchspin.rotmat2quat(R)[source]# Convert a rotation matrix to a unit quaternion. Parameters: R (array_like, shape (3, 3) or (3, 3, N)) – Proper rotation matrix/matrices. Returns: q (ndarray, shape (4,) or (4, N)) – Unit quaternion(s) with q[0] >= 0. Return type: ndarray