diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-06 14:44:40 -0500 |
---|---|---|
committer | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2016-11-06 14:44:40 -0500 |
commit | 422c86bcc684ea94515862b0dd3a39ce0f4bd86f (patch) | |
tree | a1efe6504e40083e61dcbe412c243fd8c00628f3 /gerber/utils.py | |
parent | ede065e6d16e1e4ffe970c8b13945139b3f4bcb2 (diff) | |
parent | 22e668c75f24174d2090443ed98e804b3737bd84 (diff) | |
download | gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.tar.gz gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.tar.bz2 gerbonara-422c86bcc684ea94515862b0dd3a39ce0f4bd86f.zip |
Merge upstream changes
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 |