pytransform3d.rotations.norm_matrix

pytransform3d.rotations.norm_matrix(R)[source]

Orthonormalize rotation matrix.

A rotation matrix is defined as

\boldsymbol R =
\left( \begin{array}{ccc}
    r_{11} & r_{12} & r_{13}\\
    r_{21} & r_{22} & r_{23}\\
    r_{31} & r_{32} & r_{33}\\
\end{array} \right)
\in SO(3)

and must be orthonormal, which results in 6 constraints:

  • column vectors must have unit norm (3 constraints)

  • and must be orthogonal to each other (3 constraints)

A more compact representation of these constraints is \boldsymbol R^T \boldsymbol R = \boldsymbol I.

Because of numerical problems, a rotation matrix might not satisfy the constraints anymore. This function will enforce them.

Parameters:
Rarray-like, shape (3, 3)

Rotation matrix with small numerical errors.

Returns:
Rarray, shape (3, 3)

Orthonormalized rotation matrix.

See also

check_matrix

Checks orthonormality of a rotation matrix.