Exemple #1
0
            public void unit_axis_vector_normalizes_to_self()
            {
                var actual   = VectorD.CreateUnit(4, 2);
                var expected = new VectorD(actual);

                actual.Normalize();

                Assert.Equal(expected, actual);
            }
Exemple #2
0
            public void unit_axis_vector_normalizes_to_self()
            {
                var vector   = VectorD.CreateUnit(5, 1);
                var expected = new VectorD(vector);

                var actual = vector.GetNormal();

                Assert.Equal(expected, actual);
            }
Exemple #3
0
            public void can_create_axis_unit_vector(int size, int dimension)
            {
                var expected = new VectorD(size);

                expected.Set(dimension, 1.0);

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

                Assert.Equal(expected, actual);
            }
Exemple #4
0
 public void create_axis_unit_vector_with_bad_size_throws(int size)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => VectorD.CreateUnit(size, 0));
 }