summaryrefslogtreecommitdiff
path: root/gerberex/utility.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerberex/utility.py')
-rw-r--r--gerberex/utility.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gerberex/utility.py b/gerberex/utility.py
index 852519a..f90df96 100644
--- a/gerberex/utility.py
+++ b/gerberex/utility.py
@@ -11,3 +11,11 @@ def rotate(x, y, angle, center):
angle = angle * pi / 180.0
return (cos(angle) * x0 - sin(angle) * y0 + center[0],
sin(angle) * x0 + cos(angle) * y0 + center[1])
+
+def is_equal_value(a, b, error_range=0):
+ return a - b <= error_range and a - b >= -error_range
+
+
+def is_equal_point(a, b, error_range=0):
+ return is_equal_value(a[0], b[0], error_range) and \
+ is_equal_value(a[1], b[1], error_range)