Adds a geometry module with a segment_intersection function
This commit is contained in:
parent
ca985518b0
commit
c7dd463eb5
5 changed files with 217 additions and 28 deletions
|
|
@ -1,13 +1,6 @@
|
|||
|
||||
import math
|
||||
|
||||
def euclidian_distance(node, goal):
|
||||
def x(node):
|
||||
return node[0]
|
||||
def y(node):
|
||||
return node[1]
|
||||
|
||||
return math.sqrt( (x(node) - x(goal))**2 + (y(node) - y(goal))**2)
|
||||
from geometry import x,y,euclidian_distance
|
||||
|
||||
|
||||
def astar(graph, start, goal, cost = euclidian_distance, heuristic = euclidian_distance):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue