Beispiel #1
0
            public void negative_values_produce_same_magnitude_squared()
            {
                var vector   = new Vector2F(3, 4);
                var expected = vector.GetMagnitudeSquared();

                var actual = vector.GetNegative().GetMagnitudeSquared();

                Assert.Equal(expected, actual);
            }
Beispiel #2
0
            public void can_get_negative_vector()
            {
                var source   = new Vector2F(-2, 5);
                var expected = new Vector2F(2, -5);

                var actual = source.GetNegative();

                Assert.Equal(expected, actual);
            }
Beispiel #3
0
            public void opposite_vector_angle_is_pi()
            {
                var left     = new Vector2F(14, 98);
                var right    = left.GetNegative();
                var expected = (float)Math.PI;

                var actual = left.GetAngleBetween(right);

                Assert.Equal(expected, actual, 10);
            }