Ejemplo n.º 1
0
            public void unit_axis_vector_normalizes_to_self()
            {
                var actual   = VectorF.CreateUnit(4, 2);
                var expected = new VectorF(actual);

                actual.Normalize();

                Assert.Equal(expected, actual);
            }
Ejemplo n.º 2
0
            public void unit_axis_vector_normalizes_to_self()
            {
                var vector   = VectorF.CreateUnit(5, 1);
                var expected = new VectorF(vector);

                var actual = vector.GetNormal();

                Assert.Equal(expected, actual);
            }
Ejemplo n.º 3
0
            public void can_create_axis_unit_vector(int size, int dimension)
            {
                var expected = new VectorF(size);

                expected.Set(dimension, 1.0f);

                var actual = VectorF.CreateUnit(size, dimension);

                Assert.Equal(expected, actual);
            }
Ejemplo n.º 4
0
 public void create_axis_unit_vector_with_bad_size_throws(int size)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => VectorF.CreateUnit(size, 0));
 }