code: function(xy) {
          var last, now = new Date().getTime();
          for (var i = 0, l = this.points.length, point; i < l; i++) {
              point = this.points[i];
              if (now - point.tick > this.delay) {
                  break;
              }
              last = point;
          }
          if (!last) {
              return;
          }
          var time = new Date().getTime() - last.tick;
          var dist = Math.sqrt(Math.pow(xy.x - last.xy.x, 2) +
                               Math.pow(xy.y - last.xy.y, 2));
          var speed = dist / time;
          if (speed == 0 || speed < this.threshold) {
              return;
          }
          var theta = Math.asin((xy.y - last.xy.y) / dist);
          if (last.xy.x <= xy.x) {
              theta = Math.PI - theta;
          }
          return {speed: speed, theta: theta};
      }
docs: Method: end
  Ends the dragging, start the kinetic.
  
  Parameters:
  xy - {<OpenLayers.Pixel>} The last position.
  
  Returns:
  {Object} An object with two properties: "speed", and "theta". The
  "speed" and "theta" values are to be passed to the move
  function when starting the animation.