时间:2021-07-01 10:21:17 帮助过:2人阅读
C#计算两点GPS坐标距离
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /// <summary>
///计算两点GPS坐标的距离
/// </summary>
/// <param name="n1">第一点的纬度坐标</param>
/// <param name="e1">第一点的经度坐标</param>
/// <param name="n2">第二点的纬度坐标</param>
/// <param name="e2">第二点的经度坐标</param>
/// <returns></returns>
public static double Distance(double n1, double e1, double n2, double e2)
{
double jl_jd = 102834.74258026089786013677476285;
double jl_wd = 111712.69150641055729984301412873;
double b = Math.Abs((e1 - e2) * jl_jd);
double a = Math.Abs((n1 - n2) * jl_wd);
return Math.Sqrt((a * a + b * b));
}
sql 坐标距离排序计算距离(转)
标签: