There was an error while loading. Please reload this page.
Returns the inverse of a square matrix, or nil if the matrix is not invertible.
nil
result = pymath.inverse(m)
m
n × n
n
result
See pymath for details on how a matrix is represented in the PYTHA Lua API.
local A = {{4, 7}, {2, 6}} local Ainv = pymath.inverse(A) -- Ainv == {{ 0.6, -0.7}, -- {-0.2, 0.4}} local S = {{1, 2}, {2, 4}} -- singular local Sinv = pymath.inverse(S) -- Sinv == nil
Minimum PYTHA Version: V27
pymath, pymath.dot, pymath.transpose