/// <summary>
///将度转换为弧度 by yl 2008-6-16 landgis@126.com
/// </summary>
/// <param name="d"></param>
/// <returns></returns>
public static double TransDegreeToArc(double d)
{
return d * PI / 180;
}
/// <summary>
/// 度分秒转换为弧度 by yl 2008-6-16 landgis@126.com
/// </summary>
/// <param name="d"></param>
/// <returns></returns>
public static double TransDMSToArc(string d)
{
int p = d.IndexOf(".");
if (p > -1) //存在"."
{
int Degree = Convert.ToInt16(d.Substring(0, p));//度
string str = d.Substring(p + 1);
int M = Convert.ToInt16(Substr(str, 0, 2));//分
int S = Convert.ToInt16(Substr(str, 2, 2));//秒
double SumDegree = Degree + 1.0 * M / 60 + 1.0 * S / 3600;
return TransDegreeToArc(SumDegree);
}
else
{
return TransDegreeToArc(Convert.ToDouble(d));
}
}