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

Function getDirectionAngle

packages/joint-core/src/routers/manhattan.mjs:317–323  ·  view source on GitHub ↗
(start, end, numDirections, grid, opt)

Source from the content-addressed store, hash-verified

315// returns a direction index from start point to end point
316// corrects for grid deformation between start and end
317function getDirectionAngle(start, end, numDirections, grid, opt) {
318
319 var quadrant = 360 / numDirections;
320 var angleTheta = start.theta(fixAngleEnd(start, end, grid, opt));
321 var normalizedAngle = g.normalizeAngle(angleTheta + (quadrant / 2));
322 return quadrant * Math.floor(normalizedAngle / quadrant);
323}
324
325// helper function for getDirectionAngle()
326// corrects for grid deformation

Callers 1

findRouteFunction · 0.85

Calls 1

fixAngleEndFunction · 0.85

Tested by

no test coverage detected