【问题标题】:Error rates between Haversine and VincentyHaversine 和 Vincenty 之间的错误率
【发布时间】:2017-04-13 08:32:23
【问题描述】:

我正在比较 Vincenty 公式和 hasrsine 公式在不同分离距离上的有效性。我想知道它们之间的错误率。有什么很酷的方法来绘制这些?

【问题讨论】:

    标签: matlab plot graph haversine geodesic-sphere


    【解决方案1】:

    我假设您真的想将大圆距离与 测地线距离。 Haversine 和 Vincenty 恰好是 计算这样的距离;然而,两者都会导致过多的错误 一些限制。请参阅我对Is the Haversine Formula or the Vincenty's Formula better for calculating distance? 的回复。

    我在 Matlab 中为测地线距离提供了更好的算法 包geographiclib。这也提供了准确的大圆 如果椭圆体的展平设置为 0,则距离。这是一个 绘制相对误差和绝对误差的简单说明 对于一组随机点。这要求我的包裹在你的 Matlab 路径。

    num = 100000;
    lat1 = asind(2*rand(num,1)-1);
    lat2 = asind(2*rand(num,1)-1);
    lon1 = 180*(2*rand(num,1)-1);
    lon2 = 180*(2*rand(num,1)-1);
    wgs84 = defaultellipsoid;
    a = wgs84(1);
    b = a * (1 - ecc2flat(wgs84(2)));
    sphere = [(2*a + b)/3, 0];
    [s12s, azi1s, azi2s] = geoddistance(lat1,lon1,lat2,lon2, sphere);
    [s12e, azi1e, azi2e] = geoddistance(lat1,lon1,lat2,lon2, wgs84);
    erra = (s12s - s12e);
    errr = 100 * erra ./ s12e;
    figure(1); plot(s12e, abs(errr), 'x');
    figure(2); plot(s12e, abs(erra), 'x');
    

    您可能还想看看我对How accurate is approximating the Earth as a sphere? 的回答。

    【讨论】:

      猜你喜欢
      • 2016-11-09
      • 2014-06-24
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 2011-05-19
      • 1970-01-01
      • 2012-10-26
      • 2016-10-18
      相关资源
      最近更新 更多