I have developed a spinner view for an Android application. It's like the spinner wheel on the Price Is Right with Bob Barker (If you're not familiar with that show watch this video).
I am looking to write a mathematical function that realistically computes the drag as the wheel spins around. I don't want the thing to go on forever of course.
When a user "flicks" the wheel up or down, depending on the speed of the flick, the widget will continue at the same rate. I need to add an element of drag as some sort of exponential function with respect to time.
I am thinking of two directions to go with this. Either by using an inverse exponential S(s, t) where s is the original speed and t is time. Or, I can use a logarithmic function to compute drag, and subtract that from the original speed.
What would you do? Do you have any suggestions for implementing drag realistically?
Inverse exponential is the way to go. The "drag" is caused by friction (with air, and the hinges around the wheel's edge) which is proportional to the speed of the rotation. Of course, in a purely realistic model, one has to take the air motion (both external and generated by the motion of the wheel itself) into account. But the structure of the wheel (heavy, smooth, leveraged on a hinge with minimal friction) and the fact that the friction which causes it to stop is generated mostly by the hinges, which cause stronger counter acceleration than the air resistance itself by orders of magnitude, are are dense enough to consider a continuous force rather than isolated bumps, is all made in favor of making these external forces negligible. On the bottom line, what causes the counter acceleration is constant in time, and only linearly depends on the speed of rotation, which rises a simple differential equation whose solution is an exponential with a negative power. The constants (the one in the power, and the one of the exponential itself) both depend on physical properties of the wheel, so I'd just monkey around with them until I get something which feels natural if I were you.