如何在matlab中计算地球上两点之间的中点?
82ビュ(過去30日間)
表示古いコメント
已知两点的经纬度,如何有效地求出中点?
我的问题是有数百万个点对需要计算....
2件のコメント
採用された回答
穆罕默德Abouali
2015 年 7 月 10 日
編集済み:穆罕默德Abouali
2015 年 7 月 10 日
% lat1,lat2,lon1,lon2应该是弧度
Bx = cos(lat2) * cos(lon2-lon1);
By = cos(lat2) * sin(lon2-lon1);
latMid = atan2(sin(lat1) + sin(lat2),...
√(cos(lat1)+Bx)*(cos(lat1)+Bx) + By*By));
lonMid = lon1 + atan2(By, cos(lat1) + Bx);
1件のコメント
泰德•舒尔茨
2019 年 8 月 20 日
这里是由穆罕默德提供的公式的matlab代码,但都是度。通常,lat/lon是度数,所以这个几乎相同的代码更容易使用。
函数[latMid, lonMid] = midpointLatLon(lat1, lon1, lat2, lon2)
圆球上两拉长绳的中点,单位均为度
Bx = cosd(lat2) * cosd(lon2-lon1);
By = cosd(lat2) * sind(lon2-lon1);
latMid = atan2d(sind(lat1) + sind(lat2),...
√(cosd lat1) + Bx) * (cosd (lat1) + Bx) +通过*));
lonMid = lon1 + atan2d(By, cosd(lat1) + Bx);