Beispiel #1
0
        virtual public void TestMultiply()
        {
            Matrix m1 = new Matrix(2, 3, 4, 5, 6, 7);
            Matrix m2 = new Matrix(8, 9, 10, 11, 12, 13);
            Matrix shouldBe = new Matrix(46, 51, 82, 91, 130, 144);

            Matrix rslt = m1.Multiply(m2);
            Assert.AreEqual(shouldBe, rslt);
        }
Beispiel #2
0
        public void TestCrossVector()
        {
            Vector v = new Vector(2, 3, 4);
            Matrix m = new Matrix(5, 6, 7, 8, 9, 10);
            Vector shouldBe = new Vector(67, 76, 4);

            Vector rslt = v.Cross(m);
            Assert.AreEqual(shouldBe, rslt);
        }
Beispiel #3
0
 virtual public void TestDeterminant()
 {
     Matrix m = new Matrix(2, 3, 4, 5, 6, 7);
     Assert.AreEqual(-2f, m.GetDeterminant(), .001f);
 }