Give your object two local variables to store the object's previous position, say 'oldX' and 'oldY'. Now, every tick, set the objects angle to angle(Sprite.oldX, Sprite.oldY, Sprite.X, sprite.Y), then set 'oldX' and 'oldY' to the object's current X and Y positions. At the beginning of every frame, 'oldX' and 'oldY' will hold the object's previous position, so you use that to find the angle of motion.
Let me know if you have any questions.