///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2011 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
// returns the inverse of an matrix m with adjugate
// adjugate and determinant determinant.
list wasMatrixInverse(list adjugate, float determinant) {
    // assert(determinant) != 0
    if(llGetListLength(adjugate) == 0) return [];
    float e = llList2Float(adjugate, 0);
    adjugate = llDeleteSubList(adjugate, 0, 0);
    return e/determinant + wasMatrixInverse(adjugate, determinant);
}