Function doLineSegmentsIntersect