public static void midpoint(double[][] array, int x, int y, int width, int height, double c1, double c2, double c3,
			double c4) {
		double Edge1, Edge2, Edge3, Edge4, Middle;
		int newWidth = width / 2;
		int newHeight = height / 2;
		if (width > 2 || height > 2) {
			Middle = (c1 + c2 + c3 + c4) / 4 + displace(array, newWidth + newHeight);
			Edge1 = (c1 + c2) / 2;
			Edge2 = (c2 + c3) / 2;
			Edge3 = (c3 + c4) / 2;
			Edge4 = (c4 + c1) / 2;
			midpoint(array, x, y, newWidth, newHeight, c1, Edge1, Middle, Edge4);
			midpoint(array, x + newWidth, y, newWidth, newHeight, Edge1, c2, Edge2, Middle);
			midpoint(array, x + newWidth, y + newHeight, newWidth, newHeight, Middle, Edge2, c3, Edge3);
			midpoint(array, x, y + newHeight, newWidth, newHeight, Edge4, Middle, Edge3, c4);
		}
		else {
			double k = Math.abs((c1 + c2 + c3 + c4) / 4.0);
			k *= 3.5;
			if (k > 4)
				k = 4;
			if (k < 0)
				k = 0;
			array[x][y] = k;
		}
	}