code: function orient (data, p, q, r) {
    var o = (data[q + 1] - data[p + 1]) * (data[r] - data[q]) - (data[q] - data[p]) * (data[r + 1] - data[q + 1])
    return o > 0 ? 1 : o < 0 ? -1 : 0
  }
docs: winding order of triangle formed by 3 given points