source: node_modules/d3-polygon/src/cross.js

Last change on this file was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 402 bytes
Line 
1// Returns the 2D cross product of AB and AC vectors, i.e., the z-component of
2// the 3D cross product in a quadrant I Cartesian coordinate system (+x is
3// right, +y is up). Returns a positive value if ABC is counter-clockwise,
4// negative if clockwise, and zero if the points are collinear.
5export default function(a, b, c) {
6 return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
7}
Note: See TracBrowser for help on using the repository browser.