fix a rotaion issue

This commit is contained in:
opiopan 2019-04-03 00:30:00 +09:00
parent b72d891998
commit cb420e39e2
5 changed files with 28 additions and 13 deletions

View file

@ -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)