How to use the robust-orientation function in robust-orientation

To help you get started, we’ve selected a few robust-orientation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Louis-T / fernandez-polygon-decomposition / src / utils.js View on Github external
export function orientation (point1, point2, point3) {
  if (robust) {
    const o = robustOrientation([point1.x, point1.y], [point2.x, point2.y], [point3.x, point3.y]);
    return o === 0 ? o : -o; // the y-axis is inverted
  } else {
    // return -((point1.y - point3.y) * (point2.x - point3.x) - (point1.x - point3.x) * (point2.y - point3.y));
    return (point2.x - point1.x) * (point3.y - point1.y) - (point2.y - point1.y) * (point3.x - point1.x);
  }
}

robust-orientation

Exactly computes the orientation of a tuple of points

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis

Popular robust-orientation functions