diff options
author | Garret Fick <garret@fickworkshop.com> | 2016-11-11 15:54:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-11 15:54:42 +0800 |
commit | 1e868763a1c4030bedd51553468cbe25f272bef9 (patch) | |
tree | 59cef68f1449a5be8d2a9a8ed352e3d9974a3edb /gerber/utils.py | |
parent | 5af19af190c1fb0f0c5be029d46d63e657dde4d9 (diff) | |
parent | 60d08dc8ad72f5bb0a14d4821451d7dce20b9639 (diff) | |
download | gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.gz gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.tar.bz2 gerbonara-1e868763a1c4030bedd51553468cbe25f272bef9.zip |
Merge pull request #5 from hamiltonkibbe/merge-curtacircuitos
Merge curtacircuitos
Diffstat (limited to 'gerber/utils.py')
-rw-r--r-- | gerber/utils.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gerber/utils.py b/gerber/utils.py index ef9c39e..c62ad2a 100644 --- a/gerber/utils.py +++ b/gerber/utils.py @@ -291,22 +291,22 @@ def rotate_point(point, angle, center=(0.0, 0.0)): `point` rotated about `center` by `angle` degrees. """ angle = radians(angle) - + cos_angle = cos(angle) sin_angle = sin(angle) - + return ( cos_angle * (point[0] - center[0]) - sin_angle * (point[1] - center[1]) + center[0], sin_angle * (point[0] - center[0]) + cos_angle * (point[1] - center[1]) + center[1]) 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 |