Example problem:
Decelerate a wheel from 360 degrees per second to a speed of 0 over 2.5 seconds and have the wheel rotate for 234 degrees.
The example code below doesn't use a specific time as a variable in the wheel deceleration, but the wheel will travel and slow down over the specified degrees:
I have a wheel rotating at its spinSpeed. I have calculated how many more degrees for it to rotate for, called degreesOfDeceleration and it should decelerate as it spins through these final degrees. curDegree starts at degreesOfDeceleration and goes to 0.
float speed = spinSpeed * (curDegree / degreesOfDeceleration);
float rotationDelta = speed * Time.deltaTime;
curDegree -= rotationDelta;
transform.eulerAngles = new Vector3(0.0f, 0.0f, transform.eulerAngles.z + rotationDelta);
if (curDegree <= 0.0f ) StoppedSpinningWheel();
What is missing from this example is how to force the spin to finish within a specific time. I'm not sure how.