Determining Direction Of Drag

Determining Direction Of Drag

I'm trying to determine the direction that an object is being dragged so that I can make a decision to do something based on the direction of the drag. The code below is what I have come across but it does not do what I'm looking for. 
  1.  $(".draggable").draggable({
  2.     start: function(event, ui) {
  3.         startX = ui.position.left;
  4.         startY = ui.position.top;
  5.     },
  6.     stop: function(event, ui) {
  7.         stopX = ui.position.left;
  8.         stopY = ui.position.top;
  9.     }
  10. });
I would like to know the direction of the drag as soon as the object is moving not after it had stopped.