Question with Rhumb Line Distance from Mapping Toolbox

22 ビュー (過去 30 日間)
Trung Ngo
Trung Ngo 2019 年 5 月 15 日
編集済み: Ryan Klots 2019 年 5 月 22 日
I am having a trouble with the geographical distance between 2 coordinates from Matlab's Mapping Toolbox. When I included the referenceEllipsoid('World Geodetic System 1984') to make my calculation more precise, the difference between the 2 output values is huge.
%Input Coordinates
startLat=29.7833;
startLon=49.35;
latC=30.9679414132727;
lonC=55.6527719032408;
%Distance calculation
arclen_check1 = distance('rh',startLat,startLon,latC,lonC);
arclen_check2 = distance('rh',startLat,startLon,latC,lonC,referenceEllipsoid('World Geodetic System 1984'));
Can anyone please explain why the output value between arclen_check1 and arclen_check2 is significantly different. I visitted the Matlab Reference Help but still confused with that.
Thanks for your time reading this

採用された回答

Ryan Klots
Ryan Klots 2019 年 5 月 22 日
編集済み: Ryan Klots 2019 年 5 月 22 日
When you do not specify a reference ellipsoid, the distance function computes the distance between two points on the sphere and returns the answer as an arclength in degrees (angular units).
arclen_check1 = distance('rh',startLat,startLon,latC,lonC); % Answer in degrees
When you specify a reference ellipsoid, it doesn't make sense to return the answer in angular units. Instead, it returns the distance using the same units as the reference ellipsoid itself.
e = wgs84Ellipsoid
e.LengthUnit % 'meter'
This can be verified by using the deg2km function:
arclen_check2 = distance('rh',startLat,startLon,latC,lonC,e); % Answer in meters
arclen1InMeters = deg2km(arclen_check1) * 1000; % Should be close to "arclen_check2"

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by