Пример #1
0
        public void When_ProjectOnZeroVector_Expect_ZeroVector()
        {
            Vect3 v1 = new Vect3(1, 2, 3);

            Assert.AreEqual(Vect3.Zero.ProjectOnVector(v1), Vect3.Zero);
            Assert.AreEqual(v1.ProjectOnVector(Vect3.Zero), Vect3.Zero);
        }
Пример #2
0
        public void When_ProjectVectors_Expect_Valid()
        {
            Vect3 v1 = new Vect3(1, 2, 3);
            Vect3 v2 = new Vect3(3, 2, 1);
            Vect3 v3 = new Vect3(15d / 7d, 10d / 7d, 5d / 7d);

            Assert.AreEqual(v1.ProjectOnVector(v2), v3);
        }