JS: rotate object to mouse at a constant speed
<p>So I find the angle between the cursor and the object:</p>

<pre><code>var A = Math.atan2(y-e.stageY, x-e.stageX);           
    A=A/Math.PI*180-90;
</code></pre>

<p>I also know current rotation of the object, in degrees, let's call it <code>a</code>.</p>

<p>I need to rotate the object to the angle <code>A</code>, but at a constant speed. I have a game loop where I check some flags, so basically I just need to calculate if it's faster for the object to rotate left or right to reach the angle, and also check in the loop if the object has passed the angle or not, and stop the rotation if needed.</p>
