code: public static Coordinate lineIntersection(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
  		// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
  		double x1 = c1.getX();
  		double y1 = c1.getY();
  		double x2 = c2.getX();
  		double y2 = c2.getY();
  		double x3 = c3.getX();
  		double y3 = c3.getY();
  		double x4 = c4.getX();
  		double y4 = c4.getY();
  
  		double denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  		double u1 = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom;
  
  		double x = x1 + u1 * (x2 - x1);
  		double y = y1 + u1 * (y2 - y1);
  		return new Coordinate(x, y);
  	}
docs: Calculates the intersection point of 2 lines.
  
  @param c1 First coordinate of the first line.
  @param c2 Second coordinate of the first line.
  @param c3 First coordinate of the second line.
  @param c4 Second coordinate of the second line.
  @return Returns a coordinate.