Exemplo n.º 1
0
            public void can_normalize_sample()
            {
                var actual   = new VectorF(new[] { 3.0f, 4, 5, -6 });
                var expected = actual.GetQuotient(actual.GetMagnitude());

                actual.Normalize();

                Assert.Equal(expected, actual);
            }
Exemplo n.º 2
0
            public void zero_vector_normalizes_to_zero()
            {
                var actual   = new VectorF(4);
                var expected = new VectorF(4);

                actual.Normalize();

                Assert.Equal(expected, actual);
            }
Exemplo n.º 3
0
 public void NormalizeException()
 {
     VectorF v = new VectorF(11);
       v.Normalize();
 }
Exemplo n.º 4
0
 public void Normalize()
 {
     VectorF v = new VectorF(new[] { 3.0f, -1.0f, 23.0f, 0.4f });
       v.Normalize();
       Assert.IsTrue(v.IsNumericallyNormalized);
 }