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

Function pointInTriangle

libs/mapv/mapv.js:2070–2072  ·  view source on GitHub ↗
(ax, ay, bx, by, cx, cy, px, py)

Source from the content-addressed store, hash-verified

2068
2069// check if a point lies within a convex triangle
2070function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
2071 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;
2072}
2073
2074// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
2075function isValidDiagonal(a, b) {

Callers 3

isEarFunction · 0.85
isEarHashedFunction · 0.85
findHoleBridgeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected