2020-06-08 11:49:45 +08:00
|
|
|
class MathHelper {
|
|
|
|
|
/**
|
|
|
|
|
* 将弧度转换成角度。
|
|
|
|
|
* @param radians 用弧度表示的角
|
|
|
|
|
*/
|
2020-06-08 16:23:48 +08:00
|
|
|
public static toDegrees(radians: number){
|
2020-06-08 11:49:45 +08:00
|
|
|
return radians * 57.295779513082320876798154814105;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 将角度转换为弧度
|
|
|
|
|
* @param degrees
|
|
|
|
|
*/
|
2020-06-08 16:23:48 +08:00
|
|
|
public static toRadians(degrees: number){
|
2020-06-08 11:49:45 +08:00
|
|
|
return degrees * 0.017453292519943295769236907684886;
|
|
|
|
|
}
|
|
|
|
|
}
|