double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); if (beta < 0.0 || beta > 1.0)
double a1, a2, a3, a4;   if ((a1 = area2(x1, y1, x2, y2, x3, y3)) == 0.0) {   if (between(x1, y1, x2, y2, x3, y3)) { return true; } else { if (area2(x1, y1, x2, y2, x4, y4) == 0.0) { return between(x3, y3, x4, y4, x1, y1) || between (x3, y3, x4, y4, x2, y2); } else {
  public static boolean linesIntersect(double x1, double y1,                                       double x2, double y2,                                       double x3, double y3,                                       double x4, double y4)  {    double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3))                   / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3)));		if (beta < 0.0 || beta > 1.0)			return false;		double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3);		return alpha >= 0.0 && alpha <= 1.0;	}