예제 #1
0
            public void can_find_distance_in_both_directions()
            {
                var a        = new Vector4F(16.0f, 2, 5, 3);
                var b        = new Vector4F(3.0f, 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 Vector4F(1.0f, -2, 3, 0);
                var b        = new Vector4F(4.0f, 0, -3, 5);
                var expected = 74.0f;

                var actual = a.GetDistanceSquared(b);

                Assert.Equal(expected, actual);
            }