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