# Bug with animation rate

I tried to introduce an decay to the rotation of an object in mathematica by tying the animation rate to the degree of rotation as in the picture below and it goes quite smoothly until it reaches a little more than half then it starts spinning uncontrollably the animation rate becomes random. Does anyone know the cause of this bug and how to fix it? And if you know a way to make the animation rate decays please tell me how to do it too thanks.

EDIT: My code is

Animate[Graphics[Rotate[Rectangle[], x Degree]], {x, 0, 360},DefaultDuration -> 360/(360 - x)]
Animate[Graphics[Rotate[Rectangle[], x Degree]], {x, 0, 360}, AnimationRate -> 360 - x]


• Welcome to MSE. Please edit your question to include the code you are running so it can be copied/pasted and reproduced. Nov 23, 2021 at 16:25
• Don't you think 360 is a too high value for AnimationRate? Nov 23, 2021 at 16:49
• @polfosol: Animate[Plot[{Sin[x], Cos[x], t Sin[x] + (1 - t) Cos[x]}, {x, 0, 10}], {t, 0, 1}, AnimationRate -> 360, AnimationRunning -> True] works well. Nov 23, 2021 at 18:10
• The problem relates to changing DefaultDuration within the animation. Adding DefaultDuration -> 1/(1 - t) to the final example in the Animate documentation produces the same problem. Because the documentation does not warn about this, I view the problem as a bug. Nov 23, 2021 at 18:12
• By the way, Animate[Graphics[Rotate[Rectangle[], x Degree]], {x, 0, 90}, DefaultDuration -> 360/(360 - x)] also produces the same problem. Nov 23, 2021 at 18:14