Returning a decimal number from a calculation of ranges

I'm creating an app and this app has gesture controlled animation. I'm working on a deceleration algorithm, but I'm having a little trouble with a calculation.

I have a timer served by an interval (in seconds) and I have a speed of gesture swipe. I'm having a little trouble getting the initial time interval the first time the timer fires an event.

I somehow need to map speed to interval to begin deceleration.

At it's fastest, speed is 4000 and when speed is 4000 I wish to return an interval of 0.000001 - the smallest time interval and therefore the timer will fire faster.

At it's slowest, speed is 0 and when speed is 0 I wish to return an interval of 0.01 - the largest time interval and therefore the timer will fire slower.

• What is the interval to be used for? There may be a natural way to map speed to interval. – Chris Taylor Jun 24 '11 at 17:46
if speed $\lt$ 0.4 return 0.01