You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3nar/code/function.py

19 lines
637 B

from spaceAround import *
def getSpaceIdxAround(center, nbAround, space):
if (nbAround < len(space.calculatedSpaceAroundIdx)):
spaceAround = space.calculatedSpaceAroundIdx[nbAround]
else:
spaceAround = findCoordAround(center,nbAround)
space.calculatedSpaceAroundIdx.append(spaceAround)
return applySapceAroundToCase(center,spaceAround,space)
def selectPointsInRange(points, coord, distance,space):
found = []
for point in points:
if point.getDistFromCoord(coord) <= distance:
found.append(point)
return found
def foundMaxIndex(dist):
return dist.index(max(dist))