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

Function intersectsPolygon

docs/app/js/sanddance-app.js:102055–102062  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

102053 return num > 0 ? 1 : num < 0 ? -1 : 0;
102054}
102055function intersectsPolygon(a, b) {
102056 let p = a;
102057 do {
102058 if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;
102059 p = p.next;
102060 }while (p !== a);
102061 return false;
102062}
102063function locallyInside(a, b) {
102064 return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
102065}

Callers 1

isValidDiagonalFunction · 0.70

Calls 1

intersectsFunction · 0.70

Tested by

no test coverage detected