aboutsummaryrefslogtreecommitdiff
path: root/geom.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'geom.hpp')
-rw-r--r--geom.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/geom.hpp b/geom.hpp
index e69fb81..40d6813 100644
--- a/geom.hpp
+++ b/geom.hpp
@@ -13,6 +13,12 @@ inline double frand(double a, double b) {
return r * (b - a) + a;
}
+inline double canon_angle(double ref, double move_it){
+ while (ref>move_it) move_it += 2*M_PI;
+ while (move_it >= ref + 2*M_PI) move_it -= 2*M_PI;
+ return move_it ;
+}
+
struct vec {
double x, y;