py3dframe.matrix.is_SO3#
- is_SO3(matrix, tolerance=1e-06)[source]#
Check if the given matrix is orthonormal with determinant equal to 1 (include on the special orthogonal group \(SO(3)\)).
A matrix is orthonormal if its transpose is equal to its inverse.
\[M^T = M^{-1}\]See also
function
py3dframe.matrix.is_O3()for the check of orthogonality.function
py3dframe.matrix.SO3_project()for the projection of a matrix to the special orthogonal group \(SO(3)\).
- Parameters:
matrix (array_like) – The matrix with shape (3, 3).
tolerance (float, optional) – The tolerance for the comparison of the matrix with the identity matrix. Default is 1e-6.
- Returns:
True if the matrix is in the special orthogonal group, False otherwise.
- Return type:
- Raises:
ValueError – If the matrix is not 3x3.
Examples
>>> import numpy >>> from py3dframe.matrix import is_SO3 >>> e1 = numpy.array([1, 1, 0]) >>> e2 = numpy.array([-1, 1, 0]) >>> e3 = numpy.array([0, 0, 1]) >>> matrix = numpy.column_stack((e1, e2, e3)) >>> print(is_SO3(matrix)) False
>>> import numpy >>> from py3dframe.matrix import is_SO3 >>> e1 = numpy.array([1, 1, 0]) / numpy.sqrt(2) >>> e2 = numpy.array([-1, 1, 0]) / numpy.sqrt(2) >>> e3 = numpy.array([0, 0, 1]) >>> matrix = numpy.column_stack((e1, e2, e3)) >>> print(is_SO3(matrix)) True
>>> import numpy >>> from py3dframe.matrix import is_SO3 >>> e1 = numpy.array([-1, 1, 0]) / numpy.sqrt(2) >>> e2 = numpy.array([1, 1, 0]) / numpy.sqrt(2) >>> e3 = numpy.array([0, 0, 1]) >>> matrix = numpy.column_stack((e1, e2, e3)) >>> print(is_SO3(matrix)) False
>>> import numpy >>> from py3dframe.matrix import is_SO3 >>> e1 = numpy.array([1, 1, 1]) / numpy.sqrt(3) >>> e2 = numpy.array([-1, 1, 0]) / numpy.sqrt(2) >>> e3 = numpy.array([0, 0, 1]) >>> matrix = numpy.column_stack((e1, e2, e3)) >>> print(is_SO3(matrix)) False