use np.close to check to check for vanishing denom

Just to offer users some amount of control over the tolerance.
pull/42/head
Andy Port 2018-02-27 22:38:01 -08:00 committed by GitHub
parent 89d9acf06e
commit a50c522f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -572,7 +572,7 @@ class Line(object):
d = (other_seg.start.imag, other_seg.end.imag)
denom = ((a[1] - a[0])*(d[0] - d[1]) -
(b[1] - b[0])*(c[0] - c[1]))
if abs(denom) < 1e-9:
if np.isclose(denom, 0):
return []
t1 = (c[0]*(b[0] - d[1]) -
c[1]*(b[0] - d[0]) -