code: function filterPoints(start, end) {
          if (!start)
              return start;
          if (!end)
              end = start;
          var p = start, again;
          do {
              again = false;
              if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
                  removeNode(p);
                  p = end = p.prev;
                  if (p === p.next)
                      return null;
                  again = true;
              }
              else {
                  p = p.next;
              }
          } while (again || p !== end);
          return end;
      }
docs: eliminate colinear or duplicate points