_dot = function(g, x, y, z, w) {
            var n = g[0] * x + g[1] * y;
            if (z) {
              n += g[2] * z;
              if (w) {
                n += g[3] * w;
              }
            }
            return n;
          }
Computes dot product in 2D.
@param g 2-vector (grid offset)
@param {Number} x
@param {Number} y
@param {Number} z
@param {Number} w
@return {Number} dot product
@api private