Solve edge intersections using parametric line equations instead of a form requiring the slope which breaks down for vertical lines.