diff options
author | Jean Fabre-Monplaisir <jean-isaac-fm@live.fr> | 2015-02-01 19:06:59 +0100 |
---|---|---|
committer | Jean Fabre-Monplaisir <jean-isaac-fm@live.fr> | 2015-02-01 19:06:59 +0100 |
commit | 93cd8ba7c9ea2ee22bfcb828cd5190c4662a05b0 (patch) | |
tree | 8bdaae15ed9302409756a10faec053db5aea122a /geom.hpp | |
parent | 2cb65f6726bbdecdc57b1544fe11fa6c586783dc (diff) | |
parent | 3b8497a4d6c71ac542a2992a645c00bf99d45390 (diff) | |
download | Robotique-Projet-93cd8ba7c9ea2ee22bfcb828cd5190c4662a05b0.tar.gz Robotique-Projet-93cd8ba7c9ea2ee22bfcb828cd5190c4662a05b0.zip |
Merge branch 'master' of github.com:Alexis211/Robotique
Conflicts:
problem.cpp
Diffstat (limited to 'geom.hpp')
-rw-r--r-- | geom.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -27,7 +27,7 @@ struct vec { double angle() const { if (is_nil()) return 0; double xx = x / norm(); - double a = acos(x); + double a = acos(xx); return (y >= 0 ? a : -a + 2*M_PI); } @@ -144,6 +144,10 @@ struct circle { vec at_angle(double theta) const { return c + vec(r * cos(theta), r * sin(theta)); } + + bool intersects(vec p) const { + return (c - p).norm() <= r; + } }; struct circarc { |