/ Published in: ActionScript 3
example: posX += Math.cos(Radians.fromDegrees(rotation)) * speed;
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package utils { public class Radians { public function Radians() { } /* Radians to degrees */ public static function toDegrees(radians:Number):Number { return radians * 180 / Math.PI; } /* Degrees to radians */ public static function fromDegrees(degrees:Number):Number { return degrees * Math.PI / 180; } } }