aboutsummaryrefslogtreecommitdiff
path: root/problem.hpp
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-01 20:06:45 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-01 20:06:45 +0100
commit1931b7e0e2389a9d04b07e36676f9060ebf4b9c3 (patch)
tree3ea19eb4e27991517cc8b3e355f45e8594439f81 /problem.hpp
parent2ef7173d248f994e58d4fb2d54cf6563a9041632 (diff)
downloadRobotique-Projet-1931b7e0e2389a9d04b07e36676f9060ebf4b9c3.tar.gz
Robotique-Projet-1931b7e0e2389a9d04b07e36676f9060ebf4b9c3.zip
Begin work on canonical movements.
Diffstat (limited to 'problem.hpp')
-rw-r--r--problem.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/problem.hpp b/problem.hpp
index 6eadd0a..5d9269a 100644
--- a/problem.hpp
+++ b/problem.hpp
@@ -33,6 +33,19 @@ struct hilare_a { // System A
return pos() + param->l * dir_trolley();
}
+ vec canon_curve_center() const {
+ double delta = cos(theta) * sin(theta + phi) - sin(theta) * cos(theta + phi);
+ assert(delta != 0);
+
+ vec a = pos();
+ vec b = pos_trolley();
+ vec eth = vec::from_polar(1, theta);
+ vec ethph = vec::from_polar(1, theta + phi);
+ double xc = (vec::dot(a, eth) * sin(theta + phi) - vec::dot(b, ethph) * sin(theta)) / delta;
+ double yc = (cos(theta) * vec::dot(b, ethph) - cos(theta + phi) * vec::dot(a, eth));
+ return vec(xc, yc);
+ }
+
bool intersects(const obstacle &o) const; // intersects an obstacle ?
};