difference between "geodetic2aer" and "azimuth" function

21 ビュー (過去 30 日間)
MatG
MatG 2022 年 9 月 28 日
回答済み: William Rose 2022 年 11 月 11 日
What is the difference between the azimuth from "geodetic2aer" and "azimuth" functions in matlab?
In the following example, I set the first point latitude, logintude, and altitude as lat0, long0, and h0 and those of the second point as lat, long, and h. Using "geidetic2aer" gives an azimuth of 238.08 deg while using "azimuth" gives 237.99 deg. Are the azimuth returnd by these two functions supposed to be the same or am I missing something about their meaning? I know "azimuth" returns the angle for the great circle path.
wgs84 = wgs84Ellipsoid;
lat0 = 46.017;
lon0 = 7.750;
h0 = 1673;
lat = 45.977;
lon = 7.658;
h = 4531;
format shortG
[az,elev,slantRange] = geodetic2aer(lat,lon,h,lat0,lon0,h0,wgs84)
az1= azimuth(lat0,lon0,lat,lon)

回答 (1 件)

William Rose
William Rose 2022 年 11 月 11 日
@MatG, azimuth, by default, assumes the Earth is a sphere. geodetic2aer() ias using wgs84 spheroid, in your usage. If you tell azimuth to use wgs84, they give the same result.
wgs84 = wgs84Ellipsoid;
lat0 = 46.017;
lon0 = 7.750;
h0 = 1673;
lat = 45.977;
lon = 7.658;
h = 4531;
format shortG
[az,elev,slantRange] = geodetic2aer(lat,lon,h,lat0,lon0,h0,wgs84);
az1= azimuth(lat0,lon0,lat,lon,wgs84);
fprintf('geodetic2aer: az=%.2f. azimuth(): az=%.2f.\n',az,az1);
geodetic2aer: az=238.08. azimuth(): az=238.08.
Try it.

カテゴリ

Help Center および File ExchangeMapping Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by