public void CanFindAdjoint() { Matrix2D actual = Matrix2D.Adjoint(new Matrix2D { M11 = -3, M12 = 2, M13 = -5, M21 = -1, M22 = 0, M23 = -2, M31 = 3, M32 = -4, M33 = 1 }); Matrix2D expected = new Matrix2D { M11 = -8, M12 = 18, M13 = -4, M21 = -5, M22 = 12, M23 = -1, M31 = 4, M32 = -6, M33 = 2 }; AssertMatricesAreEqual(expected, actual); }
public void CanDetectNoInverse() { Matrix2D matrix = Matrix2D.Adjoint(new Matrix2D { M11 = 1, M12 = 2, M13 = 3, M21 = 4, M22 = 5, M23 = 6, M31 = 7, M32 = 8, M33 = 9 }); Assert.IsFalse(matrix.HasInverse); }