public void InversionTest_Success() { Matrix4 mat = new Matrix4(new double[,] { { -2.0, 2.0, -3.0, -3.0 }, { -1.0, -1.0, 3.0, 3.0 }, { 2.0, 0.0, -1.0, 1.0 }, { 3.0, 2.0, 1.0, 0.0 } }); Matrix4 inverse = mat.Inverse(); Matrix4 product = mat * inverse; Assert.AreEqual(Matrix4.Identity, product); }
public void InversionTest_NonInvertible_Throws() { Matrix4 mat = new Matrix4(new double[,] { { -2.0, 2.0, -3.0, 3.0 }, { -1.0, 1.0, 3.0, -3.0 }, { 2.0, 0.0, -1.0, 1.0 }, { -3.0, 2.0, -1.0, 0.0 } }); mat.Inverse(); }