public void different_sizes_throws() { var left = new VectorF(5); var right = new VectorF(3); Assert.Throws <ArgumentOutOfRangeException>(() => left.GetDot(right)); }
public void zero_size_returns_zero() { var left = new VectorF(0); var right = new VectorF(0); var expected = 0.0; var actual = left.GetDot(right); Assert.Equal(expected, actual); }
public void can_get_dot() { var left = new VectorF(3); left.Set(0, 1.2f); left.Set(1, 3.0f); left.Set(2, -9.0f); var right = new VectorF(3); right.Set(0, -1.1f); right.Set(1, 6.7f); right.Set(2, 3.3f); var expected = (left[0] * right[0]) + (left[1] * right[1]) + (left[2] * right[2]); var actual = left.GetDot(right); Assert.Equal(expected, actual, 5); }
public void null_vector_throws() { var left = new VectorF(5); Assert.Throws <ArgumentNullException>(() => left.GetDot((VectorF)null)); }