threejs-worldgen
    Preparing search index...

    Function svd3Generic

    • A = U·diag(S)·Vᵀ for a column-major 3×3 a (a[col * 3 + row]), on any MPMOps. U and V are rotations (det +1), S is sorted by magnitude, S[0] ≥ S[1] ≥ |S[2]|, and S[2] < 0 when det A < 0. Branch-free and the same operation sequence on every backend. Degenerate input is fine: the zero matrix gives U = V = I, S = 0.

      Type Parameters

      • T

      Parameters

      Returns { S: T[]; U: T[]; V: T[] }