Class RectangleUtil

java.lang.Object
cn.net.pap.common.datastructure.rectangle.RectangleUtil

public class RectangleUtil extends Object
矩形操作 工具类
  • Constructor Details

    • RectangleUtil

      public RectangleUtil()
  • Method Details

    • isOverlap

      public static boolean isOverlap(List<List<Double>> rectangleList1, List<List<Double>> rectangleList2)
      两个矩形区域集合是否有重叠
      Parameters:
      rectangleList1 - 矩形区域集合1 [x, x', y, y']
      rectangleList2 - 矩形区域集合2 [x, x', y, y']
      Returns:
    • verticalPart

      public static List<Double[]> verticalPart(Double[] rect, Integer partSize)
      垂直切分矩形区域
      Parameters:
      rect - [x y x' y'] (x,y)左上角 (x',y')右下角
      partSize - 切分的份数
      Returns:
    • reSort

      public static void reSort(List<Double[]> rectList)
      重排序
      Parameters:
      rectList - [x, y, x', y'] 坐标集合