I am wanting to see how I can find the nullspace of a m x n matrix in javascript. In MATLAB, we can use the built-in function null(A). So I was wondering if there is something similar for javascript? I know that we could try solving the system Ax=0, but using the math.js libraries, the built-in functions come with the requirement that A is n x n or square. Which is not necessarily the case.
See for example https://mathjs.org/docs/reference/functions/lusolve.html
I'd appreciate any references to do this in javascript or how I could build such a script from scratch if needed.
Thanks!
Wanting to restrict to just what's in math.js...
If you know m > n and A has full column rank and your need is just to see what part of some m-dimensional vector v is not in the column span, then math.qr and do v - (Q' * (Q * v))
Otherwise, try math.eigs on A' * A and then pick the eigenvectors corresponding to the nearly-0 eigenvalues (according to some tolerance).