(start)
| 2056 | |
| 2057 | // find the leftmost node of a polygon ring |
| 2058 | function getLeftmost(start) { |
| 2059 | var p = start, |
| 2060 | leftmost = start; |
| 2061 | do { |
| 2062 | if (p.x < leftmost.x) leftmost = p; |
| 2063 | p = p.next; |
| 2064 | } while (p !== start); |
| 2065 | |
| 2066 | return leftmost; |
| 2067 | } |
| 2068 | |
| 2069 | // check if a point lies within a convex triangle |
| 2070 | function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { |