(ax, ay, bx, by, cx, cy, px, py)
| 2068 | |
| 2069 | // check if a point lies within a convex triangle |
| 2070 | function 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) |
| 2075 | function isValidDiagonal(a, b) { |
no outgoing calls
no test coverage detected