tools.closest_node

tools.closest_node(query, nodes)[source]

Find the closest node to the query position.

Parameters:
  • query (ndarray) – x and y coordinate of query e.g. array([2., 3.])

  • nodes (ndarray) – x and y coordinates of all nodes.

Returns:

index position of closest node in all nodes list.

Return type:

int