MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / intersectsPolygon

Function intersectsPolygon

libs/mapv/mapv.js:2096–2104  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

2094
2095// check if a polygon diagonal intersects any polygon segments
2096function intersectsPolygon(a, b) {
2097 var p = a;
2098 do {
2099 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;
2100 p = p.next;
2101 } while (p !== a);
2102
2103 return false;
2104}
2105
2106// check if a polygon diagonal is locally inside the polygon
2107function locallyInside(a, b) {

Callers 1

isValidDiagonalFunction · 0.85

Calls 1

intersectsFunction · 0.70

Tested by

no test coverage detected