Class BoundingBoxDistance

Object
org.anchoranalysis.spatial.box.BoundingBoxDistance

public class BoundingBoxDistance
extends Object
Calculates distance between two bounding boxes.
  • Method Details

    • distance

      public static double distance​(BoundingBox box1, BoundingBox box2, boolean includeZ)
      Calculates the distance between two BoundingBoxes.

      This is defined as the minimum Euclidean distance from one box's edge to the other's.

      Parameters:
      box1 - the first box.
      box2 - the second box.
      includeZ - if true, the Z-axis is included in the distance calculation, or otherwise ignored.
      Returns:
      the distance.