Use the set precision to determine wether two straight lineto (m,l) segments have the same direction and can be collapsed

This commit is contained in:
Eduard Braun 2017-05-17 00:13:11 +02:00
parent d4efcaa983
commit 20f043a17b

View file

@ -403,10 +403,14 @@ default_properties = { # excluded all properties with 'auto' as default
}
def is_same_sign(a, b): return (a <= 0 and b <= 0) or (a >= 0 and b >= 0)
def is_same_sign(a, b):
return (a <= 0 and b <= 0) or (a >= 0 and b >= 0)
def is_same_slope(x1, y1, x2, y2): return y1/x1 - y2/x2 == 0
def is_same_slope(x1, y1, x2, y2):
diff = y1/x1 - y2/x2
return scouringContext.plus(1 + diff) == 1
scinumber = re.compile(r"[-+]?(\d*\.?)?\d+[eE][-+]?\d+")