Stop a rotating object at a specified angle?
- by Krummelz
I'm working in JavaScript with HTML5 and the canvas. I have an object which is rotating at a certain speed, and I need the object's rotation to slow down gradually and the front of the object to stop at a specified angle. (I'm using radians, not degrees.) I have a variable to keep track of the angle which the object is facing, as it rotates.
How would I go about getting the object to come to rest, facing the direction I want it to?