2020-10-20 00:58:15 +02:00

37 lines
873 B
ActionScript
Executable File

/*
Copyright (c) 2009 Yahoo! Inc. All rights reserved.
The copyrights embodied in the content of this file are licensed under the BSD (revised) open source license
*/
package com.yahoo.astra.utils
{
/**
* Utility functions for common geometric operations.
*
* @author Josh Tynjala
*/
public class GeomUtil
{
/**
* Converts an angle from radians to degrees.
*
* @param radians The angle in radians
* @return The angle in degrees
*/
public static function radiansToDegrees(radians:Number):Number
{
return radians * 180 / Math.PI;
}
/**
* Converts an angle from degrees to radians.
*
* @param degrees The angle in degrees
* @return The angle in radians
*/
public static function degreesToRadians(degrees:Number):Number
{
return degrees * Math.PI / 180;
}
}
}