Accord.Math.Matrix3x3.Inverse C# (CSharp) Method

Inverse() public method

Calculate inverse of the matrix, A-1.
Cannot calculate inverse of the matrix since it is singular.
public Inverse ( ) : Matrix3x3
return Matrix3x3
        public Matrix3x3 Inverse( )
        {
            float det = Determinant;

            if ( det == 0 )
            {
                throw new ArgumentException( "Cannot calculate inverse of the matrix since it is singular." );
            }

            float detInv = 1 / det;
            Matrix3x3 m = Adjugate( );

            m.V00 *= detInv;
            m.V01 *= detInv;
            m.V02 *= detInv;

            m.V10 *= detInv;
            m.V11 *= detInv;
            m.V12 *= detInv;

            m.V20 *= detInv;
            m.V21 *= detInv;
            m.V22 *= detInv;

            return m;
        }