plugins/routers/joint.routers.manhattan.js
function getDirectionAngle(start, end, numDirections, grid, opt) {

        var quadrant = 360 / numDirections;
        var angleTheta = start.theta(fixAngleEnd(start, end, grid, opt));
        var normalizedAngle = g.normalizeAngle(angleTheta + (quadrant / 2));
        return quadrant * Math.floor(normalizedAngle / quadrant);
    }
function getDirectionAngle(start, end, numDirections, grid, opt) {

        var quadrant = 360 / numDirections;
        var angleTheta = start.theta(fixAngleEnd(start, end, grid, opt));
        var normalizedAngle = g.normalizeAngle(angleTheta + (quadrant / 2));
        return quadrant * Math.floor(normalizedAngle / quadrant);
    }
function getDirectionAngle ( start , end , numDirections , grid , opt ) { var quadrant = 360 / numDirections ; var angleTheta = start . theta ( fixAngleEnd ( start , end , grid , opt ) ) ; var normalizedAngle = g . normalizeAngle ( angleTheta + ( quadrant / 2 ) ) ; return quadrant * Math . floor ( normalizedAngle / quadrant ) ; }
returns a direction index from start point to end point corrects for grid deformation between start and end
returns a direction index from start point to end point corrects for grid deformation between start and end