code: public boolean intersect(Line other, boolean limit, Vector2f result) {
  		float dx1 = end.getX() - start.getX();
  		float dx2 = other.end.getX() - other.start.getX();
  		float dy1 = end.getY() - start.getY();
  		float dy2 = other.end.getY() - other.start.getY();
  		float denom = (dy2 * dx1) - (dx2 * dy1);
  
  		if (denom == 0) {
  			return false;
  		}
  
  		float ua = (dx2 * (start.getY() - other.start.getY()))
  				- (dy2 * (start.getX() - other.start.getX()));
  		ua /= denom;
  		float ub = (dx1 * (start.getY() - other.start.getY()))
  				- (dy1 * (start.getX() - other.start.getX()));
  		ub /= denom;
  
  		if ((limit) && ((ua < 0) || (ua > 1) || (ub < 0) || (ub > 1))) {
  			return false;
  		}
  
  		float u = ua;
  
  		float ix = start.getX() + (u * (end.getX() - start.getX()));
  		float iy = start.getY() + (u * (end.getY() - start.getY()));
  
  		result.set(ix, iy);
  		return true;
  	}
docs: Intersect this line with another
  
  @param other
  The other line we should intersect with
  @param limit
  True if the collision is limited to the extent of the lines
  @param result
  The resulting intersection point if any
  @return True if the lines intersect