You want the momentum to decrease due to friction; friction is a force that depends on speed. So technically you have a differential equation. It is not worth investing too much thought, although a solution is probably more easily achieved by hand-waving.
So: save the current angle and current angular speed. n times per second (possibly through NSTimer or CADisplayLink ) add the angular speed to the corner, then multiply the angular speed by something to reduce it - for example, 0.995. Constants close to 1.0 will slow down for longer; if you go above 1.0 it will obviously speed up. This is actually a form of Euler integration, but again, this is not worth the worry.
It might also be worth setting the minimum maximum angular speed, so if it drops below, say, 0.01 radian / second, then you reset it to 0. This effectively slightly changes your friction model to go from kinetic to static friction to suitable moment and acts as a floating point precision buffer zone.
To get the initial speed from dragging and dropping, you can simply generate a vector from the center of the wheel to start dragging, rotate this vector 90 degrees, make a point product with this and drag and drop vector and scale according to the distance from the center.
Tommy source share