Invert() публичный Метод

Returns the inverse of this matrix
public Invert ( ) : Matrix
Результат Matrix
        public void Matrix_MatrixTimesItsInverseTest()
        {
            Matrix matrix1 = new Matrix(4);

            double[] matrix1Column1 = { 1, 5, 6, 7 };
            double[] matrix1Column2 = { 2, 4, 7, 6 };
            double[] matrix1Column3 = { 3, 6, 8, 7 };
            double[] matrix1Column4 = { 7, 6, 8, 7 };

            matrix1.SetColumn(0, matrix1Column1);
            matrix1.SetColumn(1, matrix1Column2);
            matrix1.SetColumn(2, matrix1Column3);
            matrix1.SetColumn(3, matrix1Column4);

            Matrix expectedResult = Matrix.IdentityMatrix(4);

            Matrix actualResult = matrix1 * matrix1.Invert();

            bool equalityResult = (actualResult == expectedResult);

            equalityResult.Should().BeTrue();
        }
        public void Matrix_InvertTest()
        {
            Matrix matrix1 = new Matrix(3,3);

            double[] matrix1Column1 = { 1, 5, 6 };
            double[] matrix1Column2 = { 2, 4, 7 };
            double[] matrix1Column3 = { 3, 6, 8 };

            matrix1.SetColumn(0, matrix1Column1);
            matrix1.SetColumn(1, matrix1Column2);
            matrix1.SetColumn(2, matrix1Column3);

            Matrix expectedResult = new Matrix(3,3);

            double[] expectedResultColumn1 = { (double)-2 / 3, (double)-4 / 15, (double)11 / 15 };
            double[] expectedResultColumn2 = { (double)1 / 3, (double)-2 / 3, (double)1 / 3 };
            double[] expectedResultColumn3 = { (double)0, (double)3 / 5, (double)-2 / 5 };

            expectedResult.SetColumn(0, expectedResultColumn1);
            expectedResult.SetColumn(1, expectedResultColumn2);
            expectedResult.SetColumn(2, expectedResultColumn3);

            Matrix actualResult = matrix1.Invert();

            bool equalityResult = (actualResult == expectedResult);

            equalityResult.Should().BeTrue();
        }