MATH: Fix Line2d intersection functions. Fix #682
(cherry picked from commit 00a42f3d852184e34a4372b95b2339ba2bccaf26)