public static double[] line_lines_p(double x0, double y0, double x1, double y1, double[] xy, boolean continuous){
		double[] result = NONE;
		int stride = continuous ? 2 : 4;
		int np = 0;
		double[] temp = new double[xy.length];
		double f2, g2, f1g2, f2g1, det;
		double f1 = (x1 - x0);
		double g1 = (y1 - y0);
		for(int i = 0; i < xy.length - stride; i += stride){
			f2 = (xy[i+2] - xy[i]);
			g2 = (xy[i+3] - xy[i+1]);
			f1g2 = f1 * g2;
			f2g1 = f2 * g1;
			det = f2g1 - f1g2;
			if(Math.abs(det) > ACCY){
				double s = (f2*(xy[i+1] - y0) - g2*(xy[i] - x0))/ det;
				double t = (f1*(xy[i+1] - y0) - g1*(xy[i] - x0))/ det;
				if(s >= 0 && s <= 1 && t >= 0 && t <= 1){
					temp[np++] = x0 + f1 * s;
					temp[np++] = y0 + g1 * s;
				}
			}
		}
		if(np > 0){
			result = new double[np];
			System.arraycopy(temp, 0, result, 0, np);
		}
		return result;
	}