code: protected double distanceToHrect(KDTreeNode node, Instance x) throws Exception {
      double distance = 0.0;
  
      Instance closestPoint = (Instance)x.copy();
      boolean inside;
      inside = clipToInsideHrect(node, closestPoint);
      if (!inside)
        distance = m_EuclideanDistance.distance(closestPoint, x);
      return distance;
    }
docs: Returns the distance between a point and an hyperrectangle.
  
  @param node The current node from whose hyperrectangle
  the distance is to be measured.
  @param x		the point
  @return 		the distance
  @throws Exception If some problem occurs in determining
  the distance to the hyperrectangle.