Calculate (nearly) instantaneous velocity for a thing. Things like touch or mouse events. Calculating the velocity by looking at the last two events is wildly inaccurate, since the time difference between the two events being fired is often < 1ms.
This library smooths that out a bit by calculating over the last 100ms.
var Velocity =velocity =touchTarget = documenttouchTargettouchTarget
Updates the current position of the thing whose velocity you are tracking. You should do this any time you know that the thing's position has changed i.e. a touch event.
Gets the (nearly) instantaneous velocity of the thing you're tracking.
- Work with 2d, accept both x and y positions.
- Accept event objects