nullspace

compas.numerical.nullspace(A, tol=0.001)[source]

Calculates the nullspace of the input matrix A.

Parameters
  • A (array-like) – Matrix A represented as an array or list.

  • tol (float) – Tolerance.

Returns

array – Null(A).

Notes

The nullspace is the set of vector solutions to the equation

\[\mathbf{A} \mathbf{x} = 0\]

where 0 is a vector of zeros.

When determining the nullspace using SVD decomposition (A = U S Vh), the right-singular vectors (rows of Vh or columns of V) corresponding to vanishing singular values of A, span the nullspace of A.

Examples

>>> nullspace(array([[2, 3, 5], [-4, 2, 3]]))
array([[-0.03273853],
       [-0.85120179],
       [ 0.52381648]])