summaryrefslogtreecommitdiff
path: root/interval_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'interval_utils.py')
-rw-r--r--interval_utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/interval_utils.py b/interval_utils.py
index 4c3f8e2..e95445a 100644
--- a/interval_utils.py
+++ b/interval_utils.py
@@ -45,4 +45,10 @@ def find_largest_angle_interval(intervals):
intervals_ = intervals
return max(intervals_, key=lambda p:p[1]-p[0])
-
+
+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