`distance` function doesn't work for ellipsoid

1 回表示 (過去 30 日間)
Ray Lee
Ray Lee 2016 年 10 月 12 日
回答済み: Ray Lee 2016 年 10 月 12 日
e_84 = referenceEllipsoid('wgs84');
[d_84, b_84] = distance([1,2], [30,90], e_84);
throw
Error using /
Matrix dimensions must agree.
Error in geodesicinv>gpnloa (line 361)
cons = (pi - dlon)/(pi*flat);
Error in geodesicinv>gpnhri (line 215)
[az1(q11),az2(q11),sms] = gpnloa(dlon(q11),ellipsoid);
Error in geodesicinv (line 59)
[faz, baz, s] = gpnhri(phi1, lambda1, phi2, lambda2, ellipsoid);
Error in distance (line 113)
[rng(q),az(q)] = geodesicinv(lat1(q), lon1(q), lat2(q), lon2(q), ellipsoid);

採用された回答

Ray Lee
Ray Lee 2016 年 10 月 12 日
I found that it's a bug in
.../toolbox/map/map/private/geodesicinv.m
Two places of
flat = ecc2flat(ellipsoid);
should be changed to
flat = ecc2flat(ellipsoid(2));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeodesy and Mapping についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by