Skip to content

Latest commit

 

History

History
60 lines (29 loc) · 917 Bytes

File metadata and controls

60 lines (29 loc) · 917 Bytes

Home > @josh-brown/vector > inverse

inverse() function

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;

Parameters

Parameter

Type

Description

matrix

Matrix<S>

A square matrix

Returns:

Matrix<S> | undefined

The inverse matrix

Remarks

Throws an error if the matrix is not square. Returns undefined if the matrix is not invertible.