Skip to content

Documentation / @interstellar-tools/equations / det3

Function: det3() ​

ts
function det3(A: Matrix3x3Type): number;

Defined in: helpers/det-3.ts:52

Compute the determinant of a 3×3 matrix (row-major).

For:

A=[abcdefghi]

This returns:

det(A)=a(ei−fh)−b(di−fg)+c(dh−eg)

Notes:

  • Matrices are treated as row-major: A[row][col].
  • For a proper rotation matrix / DCM, det(A) ≈ +1.
  • A determinant of 0 indicates the matrix is singular (non-invertible).

Parameters ​

ParameterTypeDescription
AMatrix3x3Type3×3 matrix (row-major).

Returns ​

number

Determinant det(A).

Examples ​

ts
const I: Matrix3x3Type = [
  [1, 0, 0],
  [0, 1, 0],
  [0, 0, 1]
];

det3(I); // 1
ts
const A: Matrix3x3Type = [
  [1, 2, 3],
  [0, 1, 4],
  [5, 6, 0]
];

det3(A); // 1