How can i find the instantaneous vertical speed of the mouse at the exact moment that the mouse is released? i have the users dragging over a custo
How can i find the instantaneous vertical speed of the mouse at the exact moment that the mouse is released?
You can't. As Zeno made clear centuries ago, speed is only meaningful over a period of time. If I had to do it, I'd probably use a weighted moving average, so (for example) I computed the distance/time for each of the last 5 mouse movement messages, but their importance "decayed" over time. For example, I might multiply the most recent by 1, the next one back by .8, the next one back by .6, and so on. This way if (for example) they happen to slow down (or speed up) the movement just as they release the button, you still get a reasonable approximation of what they were doing just prior to that.