code: function isClockWise(path) {
  
              if (path.length < 3) {
                  return 0;
              }
  
              var zCount = 0;
              for (var i = 0, l = path.length; i < l; i++) {
                  var cur = path[i];
                  var prev = i === 0 ? path[l - 1] : path[i - 1];
                  var next = i === l - 1 ? path[0] : path[i + 1];
                  var z = (cur.x - prev.x) * (next.y - cur.y)
                      - (cur.y - prev.y) * (next.x - cur.x);
  
                  if (z < 0) {
                      zCount--;
                  }
                  else if (z > 0) {
                      zCount++;
                  }
              }
  
              return zCount === 0
                  ? 0
                  : zCount  < 0 ? 1 : -1;
          }
docs: 判断路径的方向是否顺时针
  see:
  http://debian.fmi.uni-sofia.bg/~sergei/cgsr/docs/clockwise.htm
  @param {Array} path 路径
  @return {number} 0 无方向 1 clockwise, -1 counter clockwise