summaryrefslogtreecommitdiff
path: root/interval_utils.py
diff options
context:
space:
mode:
authorSpitfireX <timm.weber@me.com>2015-08-12 05:51:36 +0200
committerSpitfireX <timm.weber@me.com>2015-08-12 05:51:36 +0200
commite88225c6a6d7766231ecfaacfd44eb3903a9e914 (patch)
treedaf2f78086d0d462754b5d18d1f7221ed835e0e7 /interval_utils.py
parentb521507024a38cf4c26f454be670281b357816dd (diff)
Some more angle stuff
(possibly incomplete and/or hacky)
Diffstat (limited to 'interval_utils.py')
-rw-r--r--interval_utils.py13
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