code: 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);
      }
docs: returns a direction index from start point to end point corrects for grid deformation between start and end