Skip to content

spatial-monorepo


spatial-monorepo / editor/src / invertMatrix3

Function: invertMatrix3()

invertMatrix3(m): number[]

Defined in: packages/editor/src/invertMatrix3.ts:12

Computes the inverse of a 3×3 matrix stored in row-major order.

The input m is expected to have exactly 9 elements: [ m0, m1, m2, m3, m4, m5, m6, m7, m8 ]

Returns the inverse via adjugate / determinant. Throws if the matrix is singular (determinant ≈ 0).

Parameters

m

number[]

Returns

number[]

Released under commercial licensing.