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); }
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); }
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); }
public void create_axis_unit_vector_with_bad_size_throws(int size) { Assert.Throws <ArgumentOutOfRangeException>(() => VectorD.CreateUnit(size, 0)); }