is_orthogonal_matrix#

static GeometryOperators.is_orthogonal_matrix(matrix: list, tol: float = None) bool#

Check if a given 3x3 matrix is orthogonal.

An orthogonal matrix is a square matrix whose rows and columns are orthonormal vectors. This method verifies if the transpose of the matrix multiplied by the matrix itself results in an identity matrix within a specified tolerance.

Parameters:
matrixList[List[float]]

A 3x3 matrix represented as a list of lists.

tolfloat, optional

Tolerance for numerical comparison. The default value is None. If not specified, the value is set to MathUtils.EPSILON.

Returns:
bool

True if the matrix is orthogonal, False otherwise.

Examples

Check if a matrix is orthogonal:

>>> matrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
>>> is_orthogonal_matrix(matrix)
True
>>> matrix = [[1, 0, 0], [0, 0, 1], [0, 1, 0]]
>>> is_orthogonal_matrix(matrix)
True
>>> matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> is_orthogonal_matrix(matrix)
False