Skip to content

pymath.determinant

Daniel Flassig edited this page Jun 24, 2026 · 2 revisions

Returns the determinant of a square matrix.

d = pymath.determinant(A)
Parameter Type Description
A matrix A square matrix (n × n), represented as an array of n row-vectors.

Return value

Type Description
d The determinant of A as a number.

Notes:

  • A must be square, otherwise an error is raised.

Example:

local A = {{4, 7},
           {2, 6}}
local d = pymath.determinant(A)
-- d == 10

local S = {{1, 2},
           {2, 4}}        -- singular
local ds = pymath.determinant(S)
-- ds == 0

Version Support:

Minimum PYTHA Version: V27

See also:

pymath, pymath.dot, pymath.solve_transpose, pymath.inverse

Clone this wiki locally