Javascript library for computing mouse movements (distance and direction)
Distance - returns {X: ..., Y: ..., Total: ...}
getMouseDistance({x: oldX, y: oldY}, {x: newX, y: newY});
Direction - Returns one of: [NE,NW,SE,SW,N,S,W,E]
getMouseDirection({x: oldX, y: oldY}, {x: newX, y: newY});