diff options
Diffstat (limited to 'interval_utils.py')
-rw-r--r-- | interval_utils.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/interval_utils.py b/interval_utils.py index e95445a..0d77f4f 100644 --- a/interval_utils.py +++ b/interval_utils.py @@ -49,6 +49,13 @@ def find_largest_angle_interval(intervals): def get_point_angle(origin, p): dx = p[0] - origin[0] dy = p[1] - origin[1] - rads = atan2(-dy,dx) - rads %= 2*pi - return rads + return math.atan2(dy,dx) + +def check_point_in_interval(origin, p, interval): + ang = get_point_angle(origin, p) + print(interval) + print(canonicalize_angle_interval(interval)) + if ang > interval[0] and ang < interval[1]: + return True + else: + return False
\ No newline at end of file |