MCPcopy
hub / github.com/clientIO/joint / estimateCost

Function estimateCost

packages/joint-core/src/routers/manhattan.mjs:477–487  ·  view source on GitHub ↗
(from, endPoints)

Source from the content-addressed store, hash-verified

475
476// heuristic method to determine the distance between two points
477function estimateCost(from, endPoints) {
478
479 var min = Infinity;
480
481 for (var i = 0, len = endPoints.length; i < len; i++) {
482 var cost = from.manhattanDistance(endPoints[i]);
483 if (cost < min) min = cost;
484 }
485
486 return min;
487}
488
489// find points around the bbox taking given directions into account
490// lines are drawn from anchor in given directions, intersections recorded

Callers 1

findRouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected