Home > @josh-brown/vector > inverse
Uses Gauss-Jordan elimination with pivoting to calculate the inverse of a matrix.
Signature:
export declare function inverse<S>(matrix: Matrix<S>): Matrix<S> | undefined;|
Parameter |
Type |
Description |
|---|---|---|
|
matrix |
Matrix<S> |
A square matrix |
Returns:
Matrix<S> | undefined
The inverse matrix
Throws an error if the matrix is not square. Returns undefined if the matrix is not invertible.