MCPcopy Create free account
hub / github.com/microsoft/SandDance / pointInTriangle

Function pointInTriangle

docs/app/js/sanddance-app.js:102025–102027  ·  view source on GitHub ↗
(ax, ay, bx, by, cx, cy, px, py)

Source from the content-addressed store, hash-verified

102023 return leftmost;
102024}
102025function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
102026 return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
102027}
102028function isValidDiagonal(a, b) {
102029 return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0);
102030}

Callers 3

isEarFunction · 0.70
isEarHashedFunction · 0.70
findHoleBridgeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected