Skip to content

Instantly share code, notes, and snippets.

@caubry
Last active December 13, 2015 18:59
Show Gist options
  • Save caubry/4959804 to your computer and use it in GitHub Desktop.
Save caubry/4959804 to your computer and use it in GitHub Desktop.
private function rotate(mc:MovieClip):Point
{
var o:Object = { x:mc.x, y:mc.y };
var q:Object = {};
var r:Number = mc.rotation;
r = r / 180 * Math.PI;
q.x = (Math.cos(r) * o.x) - (Math.sin(r) * o.y);
q.y = (Math.sin(r) * o.x) + (Math.cos(r) * o.y);
return new Point(q.x, q.y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment