I\'m implementing the scrolling behaviour of a touch screen UI but I\'m too tired in the moment to wrap my mind around some supposedly trivial piece of math:
y (
You can just reduce velocity by a constant amount each iteration. Example: you start with a velocity of 50, next iteration it is 40, then 30, 20, 10, stop. This would represent a constant "friction", independent of velocity, and this is actually quite close to reality (see friction on Wikipedia).
If you do not like the appearance of this, you need to make friction dependent on velocity. I would assume that a linear relationship friction = base-friction + (coefficient * velocity)
, with a rather small coefficient, would be enough.