Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Created February 22, 2010 14:54
Show Gist options
  • Save ongaeshi/311130 to your computer and use it in GitHub Desktop.
Save ongaeshi/311130 to your computer and use it in GitHub Desktop.
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
deg2rad(x);
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
rad2deg(deg2rad(x));
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
Math.sin(deg2rad(x));
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
Math.cos(deg2rad(x));
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
Math.tan(deg2rad(x));
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
var rad:Number = deg2rad(x);
sin = Math.sin(rad);
cos = Math.cos(rad);
tan = Math.tan(rad);
---
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
var result:Number = rad2deg(deg2rad(x));
floor = Math.floor(result);
ceil = Math.ceil(result);
result;
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment