colour.algebra.matrix Module¶
Matrix Helpers¶
Defines matrices computation helpers objects.
-
colour.algebra.matrix.
is_identity
(a, n=3)[source]¶ Returns if \(a\) array is an identity matrix.
Parameters: - a (array_like, (N)) – Variable \(a\) to test.
- n (int, optional) – Matrix dimension.
Returns: Is identity matrix.
Return type: Examples
>>> is_identity(np.array([1, 0, 0, 0, 1, 0, 0, 0, 1]).reshape(3, 3)) True >>> is_identity(np.array([1, 2, 0, 0, 1, 0, 0, 0, 1]).reshape(3, 3)) False