summaryrefslogtreecommitdiff
path: root/interval_utils.py
diff options
context:
space:
mode:
authorSpitfireX <timm.weber@me.com>2015-08-12 05:24:58 +0200
committerSpitfireX <timm.weber@me.com>2015-08-12 05:24:58 +0200
commit3650968ecf576fceae841f0ccd72cd8459b4aa01 (patch)
tree299940675c42e762e3056540c649a962688beb45 /interval_utils.py
parentd0f7aa9e680df92e16a31c139bab76d4ee23b208 (diff)
Made gui surface update explicit + some angle stuff
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