public static double volumeUnion(SpatialComparable box1,SpatialComparable box2){
  final int dim=assertSameDimensionality(box1,box2);
  double volume=1.;
  for (int i=0; i < dim; i++) {
    final double min=Math.min(box1.getMin(i),box2.getMin(i));
    final double max=Math.max(box1.getMax(i),box2.getMax(i));
    volume*=(max - min);
  }
  return volume;
}

public static double volumeUnion ( SpatialComparable box1 , SpatialComparable box2 ) { final int dim = assertSameDimensionality ( box1 , box2 ) ; double volume = 1. ; for ( int i = 0 ; i < dim ; i ++ ) { final double min = Math . min ( box1 . getMin ( i ) , box2 . getMin ( i ) ) ; final double max = Math . max ( box1 . getMax ( i ) , box2 . getMax ( i ) ) ; volume *= ( max - min ) ; } return volume ; }
compute the volume ( area ) of the union of two mbrs .
