We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 093bc3a commit da833c2Copy full SHA for da833c2
pgraph/PGraph.py
@@ -1410,6 +1410,21 @@ def edges(self):
1410
def heuristic_distance(self, v2):
1411
return self._graph.heuristic(self.coord - v2.coord)
1412
1413
+ def distance(self, coord):
1414
+ """
1415
+ Distance from vertex to point
1416
+
1417
+ :param coord: coordinates of the point
1418
+ :type coord: ndarray(n)
1419
+ :return: distance
1420
+ :rtype: float
1421
1422
+ Distance is computed according to the graph's metric.
1423
1424
+ :seealso: :meth:`metric`
1425
1426
+ return self._graph.metric(self.coord - coord)
1427
1428
@property
1429
def degree(self):
1430
"""
0 commit comments