docs: @Pure   
  	private static boolean intersectEdgeEdge(
  			int i0, int i1, int con, double Ax, double Ay, double[] v, double[] u1, double[] u2) {
  		// [v,b] is the segment that contains the point v
  		// [c,d] is the segment [u1,u2]
  
  		// A is the vector (v,b)
  		// B is the vector (d,c)
  		// C is the vector (c,v)
  
  		double Bx = u1[i0] - u2[i0];
  		double By = u1[i1] - u2[i1];
  		double Cx = v[i0]  - u1[i0];
  		double Cy = v[i1]  - u1[i1];
  
  		// 
  
  		double f = Ay * Bx - Ax * By;
  		double d = By * Cx - Bx * Cy; // Line equation: V+d*A
  
  		boolean up = false;
  		boolean down = false;
  
  		if (f>0) {
  			switch(con) {
  			case 1: // First point must be ignored
  				down = (d>0);
  				up = (d<=f);
  				break;
  			case 2: // Second point must be ignored
  				down = (d>=0);
  				up = (d<f);
  				break;
  			case 3: // First and Second points must be ignored
  				down = (d>0);
  				up = (d<f);
  				break;
  			default:
  				down = (d>=0);
  				up = (d<=f);
  			}
  		}
  		else if (f<0) {
  			switch(con) {
  			case 1: // First point must be ignored
  				down = (d>=f);
  				up = (d<0);
  				break;
  			case 2: // Second point must be ignored
  				down = (d>f);
  				up = (d<=0);
  				break;
  			case 3: // First and Second points must be ignored
  				down = (d>f);
  				up = (d<0);
  				break;
  			default:
  				down = (d>=f);
  				up = (d<=0);
  			}
  		}
  
  		if (up&&down) {
  			double e = Ax * Cy - Ay * Cx;
  			if (f>=0) return ((e>=0)&&(e<=f));
  			return ((e>=f)&&(e<=0));
  		}
  
  		return false;
  	}