Using the individual functions we can build a calculator that calculates the determinant of a matrix, the adjugate and the inverse of a matrix.

The calculator primitive contains the two scripts indexed below:

- The main calculator script is the one performing the computations.
- The activity monitor checks every second whether the main calculator script is active. This is useful for large matrix computations since large matrixes will take a long time to process.

The calculator expects a notecard containing a square matrix of any dimension to be dropped into the main primitive. After that, you can touch the primitive and it will start computing the determinant, adjugate and inverse of the matrix.

The script below computes the inverse of a flattened matrix in a list. The list is a row-by-row flattening of a matrix :

such that we obtain the list `m`

:

list m = [ e₀, e₁, e₂, ... ];

The method executes three steps in succession based on the Laplace method of calculating matrices:

- Calculates .
- Calculates the adjugate of as .
- Finally calculates .

The final stage assumes that since if , then the matrix does not have an inverse.

secondlife/inverse_matrix_calculator.txt · Last modified: 2017/02/22 18:20 (external edit)