Beispiel #1
0
            public void negative_values_produce_same_magnitude_squared()
            {
                var vector   = new Vector4F(0.1f, 2, 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 Vector4F(-2.0f, 5, -12, 3);
                var expected = new Vector4F(2.0f, -5, 12, -3);

                var actual = source.GetNegative();

                Assert.Equal(expected, actual);
            }
Beispiel #3
0
            public void opposite_vector_angle_is_pi()
            {
                var left     = new Vector4F(14.0f, 98, -19, 88);
                var right    = left.GetNegative();
                var expected = (float)Math.PI;

                var actual = left.GetAngleBetween(right);

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