private static int findMin(boolean useX, ArrayList<Point> convexHull) {
		int min = Integer.MAX_VALUE;
		int index = -1;
		for (int i = 0; i < convexHull.size(); i++) {
			int val = useX ? convexHull.get(i).x : convexHull.get(i).y;
			if (min > val) {
				min = val;
				index = i;
			}
		}
		return index;
	}