예제 #1
0
            public void can_find_distance_in_both_directions()
            {
                var a        = new Vector4D(16, 2, 5, 3);
                var b        = new Vector4D(3, 5, 1, -1);
                var expected = a.GetDistanceSquared(b);

                var actual = b.GetDistanceSquared(a);

                Assert.Equal(expected, actual);
            }
예제 #2
0
            public void can_find_distance()
            {
                var a        = new Vector4D(1, -2, 3, 0);
                var b        = new Vector4D(4, 0, -3, 5);
                var expected = 74.0;

                var actual = a.GetDistanceSquared(b);

                Assert.Equal(expected, actual);
            }