code: function bezier(x1, y1, x2, y2)
  {
      var p1 = [x1, y1], p2 = [x2, y2],
          A = [null, null], B = [null, null], C = [null, null],
  
          bezCoOrd = function(time, ax)
          {
              C[ax] = 3 * p1[ax]; B[ax] = 3 * (p2[ax] - p1[ax]) - C[ax]; A[ax] = 1 - C[ax] - B[ax];
              return time * (C[ax] + time * (B[ax] + time * A[ax]));
          },
  
          xDeriv = function(time)
          {
              return C[0] + time * (2 * B[0] + 3 * A[0] * time);
          },
  
          xForT = function(time)
          {
              var x = time, i = 0, z;
              while (++i < 14)
              {
                  z = bezCoOrd(x, 0) - time;
                  if (Math.abs(z) < 1e-3) break;
                  x -= z / xDeriv(x);
              }
              return x;
          };
  
      return function(time) {
          return bezCoOrd(xForT(time), 1);
      };
  }
docs: /*
  Based on Bez http://github.com/rdallasgray/bez
  
  Copyright Robert Dallas Gray. All rights reserved.
  Provided under the FreeBSD license: https://github.com/rdallasgray/bez/blob/master/LICENSE.txt