diff --git a/laby.py b/laby.py index 8fcc386..6eaa439 100644 --- a/laby.py +++ b/laby.py @@ -96,8 +96,9 @@ class Laby: return self.closest_point(center, inters) def point_in_area(self, center, dir, lgt, scatter, p): - pdir = atan2(p[1]-center[1], p[0]-center[0]) - if abs((dir+pi/2)%(2*pi)-pdir)%(2*pi)>scatter: + pdir = atan2(p[0]-center[0], p[1]-center[1])%(2*pi) + dirn = (dir)%(2*pi) + if abs(dirn-pdir)>scatter and abs(dirn-pdir+2*pi)>scatter: return False if dist(center, p) > lgt: return False diff --git a/projet-tuteure-3a b/projet-tuteure-3a index 55df928..ce0b434 160000 --- a/projet-tuteure-3a +++ b/projet-tuteure-3a @@ -1 +1 @@ -Subproject commit 55df9289cbf91dba17ffe66cad3be77ba39c8625 +Subproject commit ce0b434e97b67f3418c473741f55fd31ef20684b