计算地球轨迹的长度 - Matlab

时间:2014-10-23 19:21:01

标签: matlab geospatial

我在“n”点的Lat / Long坐标中定义了一个轨迹。我需要估计它在地球表面的长度:

Lat = [la1 la2 la3 la4 la5 la6];
Lon = [lo1 lo2 lo3 lo4 lo5 lo6];

我怎样才能在Matlab中做到这一点?我试过使用命令距离,但它似乎没有这样做?

谢谢!

1 个答案:

答案 0 :(得分:0)

[arclen,az] = distance(lat1,lon1,lat2,lon2)   
[arclen,az] = distance(lat1,lon1,lat2,lon2,ellipsoid)

检查matlab documentation

类似的东西不应该写得很难:

sum = 0;
for i=1:(size(Lat)-1)
    sum = sum + distance(Lat(i),Lon(i),Lat(i+1),Lon(i+1));
//end (Sorry I haven't used matlab in over a year, and forgot the syntax)