Use our own hypot() for older Python support
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
import importlib
|
||||
import functools
|
||||
import time
|
||||
from math import hypot, sqrt
|
||||
|
||||
from astar import AStar
|
||||
|
||||
@@ -306,7 +305,7 @@ class Pathfinder(AStar):
|
||||
def distance_between(self, n1, n2):
|
||||
(x1, y1, z1) = n1
|
||||
(x2, y2, z2) = n2
|
||||
return hypot(x2-x1, y2-y1, z2-z1)
|
||||
return utils.hypot(x2-x1, y2-y1, z2-z1)
|
||||
|
||||
def heuristic_cost_estimate(self, n1, n2):
|
||||
(x1, y1, z1) = n1
|
||||
|
||||
Reference in New Issue
Block a user