You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
823 B
C#

2 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rs.Framework
{
/// <summary>
/// 弧度&角度转换
/// </summary>
public static class AngleTool
{
/// <summary>
/// 度转弧度 2*3.14=360 PI=180 PI/180 * DEG
/// </summary>
/// <param name="deg"></param>
/// <returns></returns>
public static double Deg2Rad(double deg)
{
return Math.PI / 180 * deg;
}
/// <summary>
/// 弧度转度 2*3.14=360 PI=180 180/PI*rad
/// </summary>
/// <param name="rad"></param>
/// <returns></returns>
public static double Rad2Deg(double rad)
{
return 180/Math.PI* rad;
}
}
}