@Test public void increaseTest() { Rectangle rect = new Rectangle(1, 1, 2, 2); Rectangle inc = new Rectangle(0, 0, 4, 4); assertEquals(inc, IntGeomUtil.increase(rect, 2)); }
public static Rectangle increase(Rectangle rect, int increaseSize) { Vector newOrigin = rect.origin.sub(new Vector(increaseSize / 2, increaseSize / 2)); Vector newDimension = rect.dimension.add(new Vector(increaseSize, increaseSize)); return new Rectangle(newOrigin, newDimension); }
IntGeomUtil { public static Rectangle increase(Rectangle rect, int increaseSize) { Vector newOrigin = rect.origin.sub(new Vector(increaseSize / 2, increaseSize / 2)); Vector newDimension = rect.dimension.add(new Vector(increaseSize, increaseSize)); return new Rectangle(newOrigin, newDimension); } }
IntGeomUtil { public static Rectangle increase(Rectangle rect, int increaseSize) { Vector newOrigin = rect.origin.sub(new Vector(increaseSize / 2, increaseSize / 2)); Vector newDimension = rect.dimension.add(new Vector(increaseSize, increaseSize)); return new Rectangle(newOrigin, newDimension); }  }
IntGeomUtil { public static Rectangle increase(Rectangle rect, int increaseSize) { Vector newOrigin = rect.origin.sub(new Vector(increaseSize / 2, increaseSize / 2)); Vector newDimension = rect.dimension.add(new Vector(increaseSize, increaseSize)); return new Rectangle(newOrigin, newDimension); }  static boolean intersects(Segment s1, Segment s2); static Vector findAxisIntersection(Segment s1, Segment s2); static Rectangle increase(Rectangle rect, int increaseSize); static List<Segment> getSegments(List<Vector> path); }
IntGeomUtil { public static Rectangle increase(Rectangle rect, int increaseSize) { Vector newOrigin = rect.origin.sub(new Vector(increaseSize / 2, increaseSize / 2)); Vector newDimension = rect.dimension.add(new Vector(increaseSize, increaseSize)); return new Rectangle(newOrigin, newDimension); }  static boolean intersects(Segment s1, Segment s2); static Vector findAxisIntersection(Segment s1, Segment s2); static Rectangle increase(Rectangle rect, int increaseSize); static List<Segment> getSegments(List<Vector> path);  }