code: public Coordinate getIntersection(LineSegment lineSegment) { // may not be on either one of the line segments.
  		// http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
  		double x1 = this.x1();
  		double y1 = this.y1();
  		double x2 = this.x2();
  		double y2 = this.y2();
  		double x3 = lineSegment.x1();
  		double y3 = lineSegment.y1();
  		double x4 = lineSegment.x2();
  		double y4 = lineSegment.y2();
  
  		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: Return the intersection point of 2 lines. Yes you are reading this correctly! For this function the LineSegments
  are treated as lines. This means that the intersection point does not necessarily lie on the LineSegment (in that
  case, the {@link #intersects} function would return false).
  
  @param lineSegment
  The other LineSegment.
  @return A {@link Coordinate} representing the intersection point.