/** * Get the combined area of both objects. * * @param objA the first object * @param objB the second object * @return the area */ float getCombinedArea(Object objA, Object objB) { SpatialKey a = (SpatialKey) objA; SpatialKey b = (SpatialKey) objB; if (a.isNull()) { return getArea(b); } else if (b.isNull()) { return getArea(a); } float area = 1; for (int i = 0; i < dimensions; i++) { float min = Math.min(a.min(i), b.min(i)); float max = Math.max(a.max(i), b.max(i)); area *= max - min; } return area; }
/** * Get the combined area of both objects. * * @param objA the first object * @param objB the second object * @return the area */ float getCombinedArea(Object objA, Object objB) { SpatialKey a = (SpatialKey) objA; SpatialKey b = (SpatialKey) objB; if (a.isNull()) { return getArea(b); } else if (b.isNull()) { return getArea(a); } float area = 1; for (int i = 0; i < dimensions; i++) { float min = Math.min(a.min(i), b.min(i)); float max = Math.max(a.max(i), b.max(i)); area *= max - min; } return area; }
/** * Get the combined area of both objects. * * @param objA the first object * @param objB the second object * @return the area */ float getCombinedArea(Object objA, Object objB) { SpatialKey a = (SpatialKey) objA; SpatialKey b = (SpatialKey) objB; if (a.isNull()) { return getArea(b); } else if (b.isNull()) { return getArea(a); } float area = 1; for (int i = 0; i < dimensions; i++) { float min = Math.min(a.min(i), b.min(i)); float max = Math.max(a.max(i), b.max(i)); area *= max - min; } return area; }
/** * Get the combined area of both objects. * * @param objA the first object * @param objB the second object * @return the area */ float getCombinedArea(Object objA, Object objB) { SpatialKey a = (SpatialKey) objA; SpatialKey b = (SpatialKey) objB; if (a.isNull()) { return getArea(b); } else if (b.isNull()) { return getArea(a); } float area = 1; for (int i = 0; i < dimensions; i++) { float min = Math.min(a.min(i), b.min(i)); float max = Math.max(a.max(i), b.max(i)); area *= max - min; } return area; }