correction calcul distance
This commit is contained in:
parent
fc6e90df13
commit
e31356aeeb
5
laby.py
5
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
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 55df9289cbf91dba17ffe66cad3be77ba39c8625
|
||||
Subproject commit ce0b434e97b67f3418c473741f55fd31ef20684b
|
Loading…
x
Reference in New Issue
Block a user