Posted By

cessnajumpin on 05/13/09


math as3 as2 Degrees radians

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Degrees to Radians

 / Published in: ActionScript 3

This is something I always forget to do when working with sine and cosine; so I finally just made it into it's own function. (usage would be along the lines of: velocityX += Math.cos(degreesToRadians(movieClip.rotation)) * speed;)

  1. private function degreesToRadians(degrees:Number) : Number
  2. {
  3. return degrees * Math.PI / 180;
  4. }

Report this snippet  

You need to login to post a comment.