private static int outcode(double pX, double pY, double rectX, double rectY, double rectWidth, double rectHeight) {
		int out = 0;
		if (rectWidth <= 0) {
			out |= OUT_LEFT | OUT_RIGHT;
		} else if (pX < rectX) {
			out |= OUT_LEFT;
		} else if (pX > rectX + rectWidth) {
			out |= OUT_RIGHT;
		}
		if (rectHeight <= 0) {
			out |= OUT_TOP | OUT_BOTTOM;
		} else if (pY < rectY) {
			out |= OUT_TOP;
		} else if (pY > rectY + rectHeight) {
			out |= OUT_BOTTOM;
		}
		return out;
	}