(a, b)
| 69782 | |
| 69783 | // check if a diagonal between two polygon nodes is valid (lies in polygon interior) |
| 69784 | function isValidDiagonal(a, b) { |
| 69785 | return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges |
| 69786 | (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible |
| 69787 | (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors |
| 69788 | equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case |
| 69789 | } |
| 69790 | |
| 69791 | // signed area of a triangle |
| 69792 | function area(p, q, r) { |
no test coverage detected