plugins/routers/joint.routers.manhattan.js
function estimateCost(from, endPoints) {

        var min = Infinity;

        for (var i = 0, len = endPoints.length; i < len; i++) {
            var cost = from.manhattanDistance(endPoints[i]);
            if (cost < min) min = cost;
        }

        return min;
    }
function estimateCost(from, endPoints) {

        var min = Infinity;

        for (var i = 0, len = endPoints.length; i < len; i++) {
            var cost = from.manhattanDistance(endPoints[i]);
            if (cost < min) min = cost;
        }

        return min;
    }
function estimateCost ( from , endPoints ) { var min = Infinity ; for ( var i = 0 , len = endPoints . length ; i < len ; i ++ ) { var cost = from . manhattanDistance ( endPoints [ i ] ) ; if ( cost < min ) min = cost ; } return min ; }
heuristic method to determine the distance between two points
heuristic method to determine the distance between two points