warp.quat_from_matrix#
- warp.quat_from_matrix(
- mat: Matrix[Float, Literal[3], Literal[3]],
Return the rotation quaternion of the rotation matrix
mat.- Parameters:
mat – Rotation matrix that rotates column vectors as
mat @ v. It must be orthonormal with a determinant of+1; otherwise, the result is unspecified. Matrices using row-vector conventions must be transposed first.- Returns:
A unit quaternion
qsuch thatquat_to_matrix(q)equalsmat. The sign ofqis unspecified.
- warp.quat_from_matrix(
- mat: Matrix[Float, Literal[4], Literal[4]],
Return the rotation quaternion of the top-left 3x3 block of
mat.- Parameters:
mat – Transformation matrix whose top-left 3x3 block rotates column vectors. That block must be orthonormal with a determinant of
+1; otherwise, the result is unspecified. The remaining entries, such as a translation, are ignored.- Returns:
A unit quaternion
qsuch thatquat_to_matrix(q)equals the top-left 3x3 block ofmat. The sign ofqis unspecified.