aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Fabre-Monplaisir <jean-isaac-fm@live.fr>2015-02-01 19:21:28 +0100
committerJean Fabre-Monplaisir <jean-isaac-fm@live.fr>2015-02-01 19:21:28 +0100
commit74fb9253d61e29cbe8dd0125cbbeda3069b096b5 (patch)
treebd72467b0f6885d6d607451fc8a17a047f11eb8b
parent93cd8ba7c9ea2ee22bfcb828cd5190c4662a05b0 (diff)
downloadRobotique-Projet-74fb9253d61e29cbe8dd0125cbbeda3069b096b5.tar.gz
Robotique-Projet-74fb9253d61e29cbe8dd0125cbbeda3069b096b5.zip
add canon_angle
-rw-r--r--geom.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/geom.hpp b/geom.hpp
index 06b9e65..62e9642 100644
--- a/geom.hpp
+++ b/geom.hpp
@@ -7,6 +7,12 @@
#define EPSILON 1e-6
#define abs(x) ((x)<0?-(x):(x))
+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;