d2d1: Introduce a separate function for calculating line/line intersections.