code: function turn(p, q, r) {
      // Returns -1, 0, 1 if p,q,r forms a right, straight, or left turn.
      return cmp((q[0] - p[0]) * (r[1] - p[1]) - (r[0] - p[0]) * (q[1] - p[1]), 0);
    }
docs: /*
  Internal: used to determine turn