public void can_normalize_sample() { var vector = new VectorD(new[] { 3.0, 4, 5, -6 }); var expected = vector.GetQuotient(vector.GetMagnitude()); var actual = vector.GetNormal(); Assert.Equal(expected, actual); }
public void source_vector_is_unchanged() { var actual = new VectorD(2); actual.Set(0, 4.5); actual.Set(1, 888); var expected = new VectorD(actual); var result = actual.GetQuotient(2); Assert.Equal(expected, actual); }
public void can_get_quotient_vector() { var source = new VectorD(2); source.Set(0, 4.5); source.Set(1, 888); var expected = new VectorD(2); expected.Set(0, 4.5 / 4.0); expected.Set(1, 888 / 4.0); var actual = source.GetQuotient(4); Assert.Equal(expected, actual); }