difference between "geodetic2aer" and "azimuth" function

조회 수: 4 (최근 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 CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by