static public Point2D.Double getSegIntersection(Line2D.Double line1, Line2D.Double line2) {
		final double u;
		if (isVertical(line2)) {
			u = getIntersectionVertical(line1, line2.getP1().getX());
		} else if (isHorizontal(line2)) {
			u = getIntersectionHorizontal(line1, line2.getP1().getY());
		} else {
			throw new UnsupportedOperationException();
		}
		if (java.lang.Double.isNaN(u) || u < 0 || u > 1) {
			return null;
		}
		final Point2D.Double result = getPoint2D(line1, u);
		if (isBetween(result, line2.getP1(), line2.getP2())) {
			return result;
		}
		return null;
	}