correction calcul distance

This commit is contained in:
leo 2022-11-28 16:38:30 +01:00
parent fc6e90df13
commit e31356aeeb
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB
2 changed files with 4 additions and 3 deletions

View File

@ -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

@ -1 +1 @@
Subproject commit 55df9289cbf91dba17ffe66cad3be77ba39c8625
Subproject commit ce0b434e97b67f3418c473741f55fd31ef20684b