private double closestPairRec(Point[] pX, Point[] pY, Point[] aux, int lo, int hi) {
		
		if (lo >= hi) return Double.POSITIVE_INFINITY;
		int mid = (lo + hi) / 2;
		double delta1, delta2;
		closestPairSplit(pY, aux, lo, mid, hi);
		delta1 = closestPairRec(pX, pY, aux, lo, mid);
		delta2 = closestPairRec(pX, pY, aux, mid + 1, hi);
		closestPairMerge(pY, aux, lo, mid, hi);
		double delta = Math.min(delta1, delta2);
		int M = 0;
		for (int i = lo; i <= hi; i++) {
			if (pY[i].x < delta)
				aux[M++] = pY[i];
		}
		for (int i = 0; i < M - 1; i++) {
			for (int j = i + 1; j < M && j < i + 7 + 1; j++) {
				if (aux[j].y - aux[i].y < delta){
					double dis = aux[j].distanceTo(aux[i]);
					if (dis < delta) {
						delta = dis;
						if (dis < distance) {
							distance = dis;
							p1 = aux[i];
							p2 = aux[j];
						}
					}
				}
			}
		}
		return delta;
	}