summaryrefslogtreecommitdiff
path: root/gerber/utils.py
diff options
context:
space:
mode:
authorGarret Fick <garret@ficksworkshop.com>2016-04-23 13:32:32 +0800
committerGarret Fick <garret@ficksworkshop.com>2016-04-23 13:32:32 +0800
commitaf86c5c5a228855f40ecbf02074bbec65fd9b6d1 (patch)
treeb55665a983d25d7a98f292dbb50e5ee39904a20a /gerber/utils.py
parent2eac1e427ca3264cb6dc36e0712020c1ca73fa9c (diff)
downloadgerbonara-af86c5c5a228855f40ecbf02074bbec65fd9b6d1.tar.gz
gerbonara-af86c5c5a228855f40ecbf02074bbec65fd9b6d1.tar.bz2
gerbonara-af86c5c5a228855f40ecbf02074bbec65fd9b6d1.zip
Correctly find the center for single quadrant arcs
Diffstat (limited to 'gerber/utils.py')
-rw-r--r--gerber/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gerber/utils.py b/gerber/utils.py
index 72bf2d1..41d264a 100644
--- a/gerber/utils.py
+++ b/gerber/utils.py
@@ -297,3 +297,9 @@ def nearly_equal(point1, point2, ndigits = 6):
'''Are the points nearly equal'''
return round(point1[0] - point2[0], ndigits) == 0 and round(point1[1] - point2[1], ndigits) == 0
+
+def sq_distance(point1, point2):
+
+ diff1 = point1[0] - point2[0]
+ diff2 = point1[1] - point2[1]
+ return diff1 * diff1 + diff2 * diff2