public static double enlargementScaled(SpatialComparable exist,SpatialComparable addit,double scale){
  final int dim=assertSameDimensionality(exist,addit);
  double v1=1.;
  double v2=1.;
  for (int i=0; i < dim; i++) {
    final double emin=exist.getMin(i);
    final double emax=exist.getMax(i);
    final double amin=addit.getMin(i);
    final double amax=addit.getMax(i);
    final double min=Math.min(emin,amin);
    final double max=Math.max(emax,amax);
    v1*=(max - min) * scale;
    v2*=(emax - emin) * scale;
  }
  return v2 - v1;
}

public static double enlargementScaled ( SpatialComparable exist , SpatialComparable addit , double scale ) { final int dim = assertSameDimensionality ( exist , addit ) ; double v1 = 1. ; double v2 = 1. ; for ( int i = 0 ; i < dim ; i ++ ) { final double emin = exist . getMin ( i ) ; final double emax = exist . getMax ( i ) ; final double amin = addit . getMin ( i ) ; final double amax = addit . getMax ( i ) ; final double min = Math . min ( emin , amin ) ; final double max = Math . max ( emax , amax ) ; v1 *= ( max - min ) * scale ; v2 *= ( emax - emin ) * scale ; } return v2 - v1 ; }
compute the enlargement obtained by adding an object to an existing object .
