Ejemplo n.º 1
0
        public void T10_CoFactors()
        {
            Mat3 mat3 = new Mat3(3, 5, 0, 2, -1, -7, 6, -1, 5);

            Assert.AreEqual(-12, mat3.Minor(0, 0));
            Assert.AreEqual(-12, mat3.Cofactor(0, 0));
            Assert.AreEqual(25, mat3.Minor(1, 0));
            Assert.AreEqual(-25, mat3.Cofactor(1, 0));
        }
Ejemplo n.º 2
0
        public void T11_Det()
        {
            Mat3 a = new Mat3(1, 2, 6, -5, 8, -4, 2, 6, 4);

            Assert.AreEqual(56, a.Cofactor(0, 0));
            Assert.AreEqual(12, a.Cofactor(0, 1));
            Assert.AreEqual(-46, a.Cofactor(0, 2));
            Assert.AreEqual(-196, a.Det());

            Mat4 b = new Mat4(-2, -8, 3, 5, -3, 1, 7, 3, 1, 2, -9, 6, -6, 7, 7, -9);

            Assert.AreEqual(-4071, b.Det());
        }