warp.quat_from_matrix#

warp.quat_from_matrix(
mat: Matrix[Float, Literal[3], Literal[3]],
) → Quaternion[Float]#
  • Kernel: true
  • Python: true
  • Differentiable: true

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 q such that quat_to_matrix(q) equals mat. The sign of q is unspecified.

warp.quat_from_matrix(
mat: Matrix[Float, Literal[4], Literal[4]],
) → Quaternion[Float]
  • Kernel: true
  • Python: true
  • Differentiable: true

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 q such that quat_to_matrix(q) equals the top-left 3x3 block of mat. The sign of q is unspecified.