Return to Snippet

Revision: 32826
at October 2, 2010 20:04 by bshantz


Initial Code
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;
		}
	}
}

Initial URL

                                

Initial Description
example: posX +=  Math.cos(Radians.fromDegrees(rotation)) * speed;

Initial Title
Radians / Degrees Utility AS3

Initial Tags

                                

Initial Language
ActionScript 3