public static boolean testContainment(double xin, double yin,
			double[] pointsx, double[] pointsy) {
		int i, j;
		boolean result = false;
		for (i = 0, j = pointsx.length - 1; i < pointsx.length; j = i++) {
			if ((pointsy[i] > yin) != (pointsy[j] > yin)
					&& (xin < (pointsx[j] - pointsx[i]) * (yin - pointsy[i])
							/ (pointsy[j] - pointsy[i]) + pointsx[i])) {
				result = !result;
			}
		}
		return result;
	} // End testContainment