Skip to content

Modern Math Determinant

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › Determinant

Determinant

Returns the determinant of a matrix; zero means it has no inverse.

Syntax

Determinant( byref a as Mat4 ) as float32

Notes

  • Zero means the matrix is singular and has no inverse -- which is what TryInverse checks before doing any work.
  • Its sign says whether the transform flips handedness, which is what turns a surface inside out.
  • Its magnitude is the volume scale factor of the transform.

Examples

#import "std/numeric"
using numeric

dim as Mat4 m
for i as int32 = 0 to 15
    m.m( i ) = 0
next
for i as int32 = 0 to 3
    m.m( i * 4 + i ) = 1     '' the identity
next

print Determinant( m )       '' 1

'' A singular matrix has determinant zero and no inverse
dim as Mat4 s = m
s.m( 0 ) = 0
print Determinant( s )       '' 0

Library: Math Library
Category: Math Library
Documented under: Members

Clone this wiki locally