Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

Convert Degrees To Radians And Radians To Degrees


var degrees = 90;

var radians = degreesToRadians(degrees);
degrees = radiansToDegrees(radians);

trace(radians); //Outputs 1.57
trace(degrees); //Outputs 90

function degreesToRadians(degrees:Number):Number {
return degrees * Math.PI / 180;
}

function radiansToDegrees(radians:Number):Number{
return radians * 180 / Math.PI;
}

0 comments:

Post a Comment