code: function getLeftmost(start) {
         var p = start,
             leftmost = start;
         do {
             if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
             p = p.next;
         } while (p !== start);
  
         return leftmost;
     }
docs: find the leftmost node of a polygon ring