def getWithinNodes( self, pixelTable, width ): circleOverWidth = self.circle / width x = int( round( circleOverWidth.real ) ) y = int( round( circleOverWidth.imag ) ) withinNodes = [] squareValues = euclidean.getSquareValues( pixelTable, x, y ) for squareValue in squareValues: if abs( self.circle - squareValue.circle ) < self.diameter: withinNodes.append( squareValue ) return withinNodes
def isWithinCircles( self, pixelTable, width ): absolutePosition = self.getAbsolutePosition() absolutePositionOverWidth = absolutePosition / width x = int( round( absolutePositionOverWidth.real ) ) y = int( round( absolutePositionOverWidth.imag ) ) squareValues = euclidean.getSquareValues( pixelTable, x, y ) for squareValue in squareValues: if abs( squareValue.circle - absolutePosition ) < self.circleNodeAhead.radius: if squareValue != self.circleNodeAhead and squareValue != self.circleNodeBehind: return True return False