From ad4173e1c2bb55d2cce827067dfd132e8a6a7ac4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 8 Jan 2015 15:27:47 +0100 Subject: Add geometry functions & various modifications. --- problem.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'problem.hpp') diff --git a/problem.hpp b/problem.hpp index 535affa..10adaf8 100644 --- a/problem.hpp +++ b/problem.hpp @@ -16,9 +16,14 @@ struct hilare_a { // System A // position actuelle double x, y, theta, phi; + vec pos() const { return vec(x, y); } + vec dir() const { return vec::from_polar(1, theta); } + vec pos_trolley() const { - //TODO - return vec(0, 0); + return pos() + vec::from_polar(l, theta + phi + M_PI); + } + vec dir_trolley() const { + return vec::from_polar(1, theta + phi); } }; -- cgit v1.2.3