public static boolean line_box_xyxy(double lx0, double ly0, double lx1, double ly1, double rx0, double ry0, double rx1, double ry1) {
		int out1, out2;
		double rectWidth = rx1 - rx0;
		double rectHeight = ry1 - ry0;
		
		if ((out2 = outcode(lx1, ly1, rx0, ry0, rectWidth, rectHeight)) == 0) {
			return true;
		}
		while ((out1 = outcode(lx0, ly0, rx0, ry0, rectWidth, rectHeight)) != 0) {
			if ((out1 & out2) != 0) {
				return false;
			}
			if ((out1 & (OUT_LEFT | OUT_RIGHT)) != 0) {
				double x = rx0;
				if ((out1 & OUT_RIGHT) != 0) {
					x += rectWidth;
				}
				ly0 = ly0 + (x - lx0) * (ly1 - ly0) / (lx1 - lx0);
				lx0 = x;
			} else {
				double y = ry0;
				if ((out1 & OUT_BOTTOM) != 0) {
					y += rectHeight;
				}
				lx0 = lx0 + (y - ly0) * (lx1 - lx0) / (ly1 - ly0);
				ly0 = y;
			}
		}
		return true;
	}