code: public double sqrMaxDistance(Envelope2D other) {
  		if (isEmpty() || other.isEmpty())
  			return NumberUtils.TheNaN;
  
  		double dist = 0;
  		Point2D[] points = new Point2D[4];
  		queryCorners(points);
  		Point2D[] points_o = new Point2D[4];
  		other.queryCorners(points_o);
  		for (int i = 0; i < 4; i++) {
  			for (int j = 0; j < 4; j++) {
  				double d = Point2D.sqrDistance(points[i], points_o[j]);
  				if (d > dist) {
  					dist = d;
  				}
  			}
  		}
  
  		return dist;
  	}
docs: Returns squared max distance between two bounding boxes. This is furthest distance between points on the two envelopes.
  
  @param other The bounding box to calculate the max distance two.
  @return Squared distance value.