Beispiel #1
0
        public void DotProduct()
        {
            Random Rand = new Random();
            Vector2D TestVector2D1 = new Vector2D(Rand.NextDouble() * 1000, Rand.NextDouble() * 1000);
            Vector2D TestVector2D2 = new Vector2D(Rand.NextDouble() * 1000, Rand.NextDouble() * 1000);
            double Cross2D = TestVector2D1.Dot(TestVector2D2);

            Vector3D TestVector3D1 = new Vector3D(TestVector2D1.x, TestVector2D1.y, 0);
            Vector3D TestVector3D2 = new Vector3D(TestVector2D2.x, TestVector2D2.y, 0);
            double Cross3D = TestVector3D1.Dot(TestVector3D2);

            Assert.IsTrue(Cross3D == Cross2D);
        }
Beispiel #2
0
 public void DotProduct()
 {
     Vector3D Test1 = new Vector3D(10, 1, 2);
     Vector3D Test2 = new Vector3D(1, 0, 0);
     double DotResult = Test2.Dot(Test1);
     Assert.IsTrue(DotResult == 10);
 }