public void Simple() { var vector = new Vector2D(4, 7); vector.Increment(); Assert.AreEqual(5, vector.X); Assert.AreEqual(8, vector.Y); }
public void OperatorDivideDoubleExample() { var vector2D = new Vector2D(4, 12); var vector = vector2D/2; Assert.AreEqual(2, vector.X); Assert.AreEqual(6, vector.Y); }
public void Simple() { var vector = new Vector2D { X = 1, Y = 2 }; Assert.AreNotEqual(0, vector.GetHashCode()); Assert.AreEqual(1, vector.X); Assert.AreEqual(2, vector.Y); }
public void ExceptionLeftNull() { const Vector2D vector1 = null; var vector2 = new Vector2D(2, 2); var condition = vector1 <= vector2; }
public void Simple() { var vector = new Vector2D { X = 1, Y = 2 }; vector.SetValues(4, 6); Assert.AreEqual(4, vector.X); Assert.AreEqual(6, vector.Y); }
public void ExceptionRightNull() { var vector1 = new Vector2D(2, 2); const Vector2D vector2 = null; var condition = vector1 >= vector2; }
public void Simple() { var vector2D = new Vector2D(); Assert.AreEqual(2, vector2D.DimensionCount); Assert.AreEqual(0, vector2D.X); Assert.AreEqual(0, vector2D.Y); }
public void OperatorDivideVectorExample() { var vector2D1 = new Vector2D(4, 8); var vector2D2 = new Vector2D(2, 2); var vector = vector2D1/vector2D2; Assert.AreEqual(1, vector.X); Assert.AreEqual(2, vector.Y); }
public void AbsoluteMaximumExample() { var vector1 = new Vector2D(1, -4); Assert.AreEqual(4, vector1.AbsoluteMaximum()); var vector2 = new Vector2D(5, -4); Assert.AreEqual(5, vector2.AbsoluteMaximum()); }
public void Simple() { var vector = new Vector2D(23, 21); vector.Normalize(); Assert.AreEqual(1, vector.Magnitude()); }
public void Simple() { var vector = new Vector2D(1, -4); Assert.AreEqual(-4, vector.Minimum()); Assert.AreEqual(1, vector.X); Assert.AreEqual(-4, vector.Y); }
public void AbsoluteMinimumIndexExample() { var vector1 = new Vector2D(1, -4); Assert.AreEqual(0, vector1.AbsoluteMinimumIndex()); var vector2 = new Vector2D(-4, 1); Assert.AreEqual(1, vector2.AbsoluteMinimumIndex()); }
public void Simple() { var vector2D = new Vector2D(4, 7); vector2D--; Assert.AreEqual(3, vector2D.X); Assert.AreEqual(6, vector2D.Y); }
public void AddDoubleExample() { var vector = new Vector2D(4, 7); vector.Add(1); Assert.AreEqual(5, vector.X); Assert.AreEqual(8, vector.Y); }
public void Simple() { var vector = new Vector2D(2, 3); Assert.AreEqual(5, vector.Sum()); Assert.AreEqual(2, vector.X); Assert.AreEqual(3, vector.Y); }
public void Simple() { var vector = new Vector2D(3, 7); vector.Clear(); Assert.AreEqual(0, vector.X); Assert.AreEqual(0, vector.Y); }
public void Simple() { var vector = new Vector2D(2, 3); Assert.AreEqual(3.6055512754639891d, vector.Magnitude()); Assert.AreEqual(2, vector.X); Assert.AreEqual(3, vector.Y); }
public void Simple() { var vector = new Vector2D(2, 3); Assert.AreEqual(6, vector.Product()); Assert.AreEqual(2, vector.X); Assert.AreEqual(3, vector.Y); }
public void Double() { var vector = new Vector2D(9, 3); vector.Divide(3); Assert.AreEqual(3, vector.X); Assert.AreEqual(1, vector.Y); }
public void Simple() { var vector = new Vector2D(1, 2); vector.Negate(); Assert.AreEqual(-1, vector.X); Assert.AreEqual(-2, vector.Y); }
public void OperatorDecrementExample() { var vector2D = new Vector2D(4, 7); vector2D--; Assert.AreEqual(3, vector2D.X); Assert.AreEqual(6, vector2D.Y); }
public void Double() { var vector = new Vector2D(1, 2); vector.Multiply(2); Assert.AreEqual(2, vector.X); Assert.AreEqual(4, vector.Y); }
public void Simple() { var vector = new Vector2D(4, 7); vector.Decrement(); Assert.AreEqual(3, vector.X); Assert.AreEqual(6, vector.Y); }
public void DifferentValues() { var vector1 = new Vector2D(1, 0); var vector2 = new Vector2D(2, 0); Assert.IsFalse(vector1.Equals(vector2)); Assert.AreEqual(1, vector1.X); Assert.AreEqual(2, vector2.X); }
public void Simple() { var vector1 = new Vector2D(1, 1); var vector2 = new Vector2D(2, 2); var vector3 = new Vector2D(2, 2); Assert.IsFalse(vector1 >= vector2); Assert.IsTrue(vector2 >= vector1); Assert.IsTrue(vector2 >= vector3); }
public void Simple() { var vector2D = new Vector2D { X = 1, Y = 2 }; var vector = -vector2D; Assert.AreEqual(-1, vector.X); Assert.AreEqual(-2, vector.Y); Assert.AreEqual(1, vector2D.X); Assert.AreEqual(2, vector2D.Y); Assert.AreNotSame(vector2D, vector); }
public void Double() { var vector2D = new Vector2D(4, 7); var vector = vector2D + 2; Assert.AreEqual(6, vector.X); Assert.AreEqual(9, vector.Y); Assert.AreEqual(4, vector2D.X); Assert.AreEqual(7, vector2D.Y); Assert.AreNotSame(vector2D, vector); }
public void Double() { var vector = new Vector2D(4, 7) { 1 }; Assert.AreEqual(5, vector.X); Assert.AreEqual(8, vector.Y); }
public void Simple() { var vector2D1 = new Vector2D { X = 1, Y = 2 }; var vector2D2 = new Vector2D { X = 1, Y = 2 }; Assert.IsTrue(vector2D1 == vector2D2); Assert.AreEqual(1, vector2D1.X); Assert.AreEqual(2, vector2D1.Y); Assert.AreEqual(1, vector2D2.X); Assert.AreEqual(2, vector2D2.Y); }
public void Simple() { var vector = new Vector2D(8, 3); var actual = vector.ToArray(); Assert.AreEqual(2, actual.Length); Assert.AreEqual(8, actual[0]); Assert.AreEqual(3, actual[1]); }