/// <summary> /// Creates a bound from two arbitrary points. Contrary to the constructor, /// this method always creates a non-empty box. /// </summary> /// <param name="a"> The first point. </param> /// <param name="b"> The second point. </param> /// <returns> The convex hull. </returns> public static Vector2dBounds FromCoordinates(Vector2d a, Vector2d b) { var bounds = new Vector2dBounds(a, a); bounds.Extend(b); return(bounds); }
public void Extend() { var bounds1 = new Vector2dBounds(new Vector2d(-10, -10), new Vector2d(10, 10)); var bounds2 = new Vector2dBounds(new Vector2d(-20, -20), new Vector2d(20, 20)); bounds1.Extend(bounds2); Assert.AreEqual(bounds1.South, bounds2.South); Assert.AreEqual(bounds1.West, bounds2.West); Assert.AreEqual(bounds1.North, bounds2.North); Assert.AreEqual(bounds1.East, bounds2.East); }