math_matrix_calculator
Perform finite-precision linear-algebra operations on small matrices up to 8x8: add, subtract, multiply, transpose, determinant, inverse, and identity construction.
Instructions
Matrix Calculator. Perform finite-precision linear-algebra operations on small matrices: add, subtract, multiply, scalarMultiply, transpose, determinant (cofactor for n<=3, LU with partial pivoting for n>=4), inverse (Gauss-Jordan), and identity construction. Matrices are arrays of rows (each row an array of finite numbers), capped at 8x8. Preconditions: add/subtract need equal dimensions; multiply needs cols(a) == rows(b); determinant and inverse need a square matrix and inverse additionally needs it to be non-singular. Use math_scientific_calculator for scalar expressions, math_statistics_calculator for dataset statistics, or math_quadratic_solver for polynomial roots. Runs locally on the numbers you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/minute for anonymous callers). Returns the resulting matrix (array of rows of numbers) for most operations, or a single number for determinant.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Operation to perform. add/subtract/multiply use a and b; scalarMultiply uses matrix and scalar; transpose/determinant/inverse use matrix; identity uses size. | |
| a | No | First operand matrix for add, subtract, multiply. Array of rows; each row an array of finite numbers. Max 8 rows and 8 columns; must be rectangular. | |
| b | No | Second operand matrix for add, subtract, multiply. For add/subtract must match the dimensions of a; for multiply rows(b) must equal cols(a). | |
| matrix | No | Single operand matrix for scalarMultiply, transpose, determinant, inverse. Array of rows of finite numbers, max 8x8. determinant and inverse require it to be square. | |
| scalar | No | Finite scalar multiplier used only by scalarMultiply. | |
| size | No | Dimension n of the identity matrix to build (n x n). Used only by identity. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when the calculation succeeded. | |
| operation | No | The operation that was performed, echoed back. | |
| result | No | For determinant a single number; for all other operations the resulting matrix as an array of rows of numbers. |