Main Content

aer2geodetic

Transform local spherical coordinates to geodetic

Description

example

[lat,lon,h] = aer2geodetic(az,elev,slantRange,lat0,lon0,h0,spheroid) transforms the local azimuth-elevation-range (AER) spherical coordinates specified by az, elev, and slantRange to the geodetic coordinates specified by lat, lon, and h. Specify the origin of the local AER system with the geodetic coordinates lat0, lon0, and h0. Each coordinate input argument must match the others in size or be scalar. Specify spheroid as the reference spheroid for the geodetic coordinates.

[___] = aer2geodetic(___,angleUnit) specifies the units for azimuth, elevation, latitude, and longitude. Specify angleUnit as 'degrees' (the default) or 'radians'.

Examples

collapse all

Find the geodetic coordinates of the Matterhorn, using the AER coordinates of the Matterhorn with respect to the geodetic coordinates of Zermatt, Switzerland.

First, specify the reference spheroid as WGS 84. For more information about WGS 84, see Comparison of Reference Spheroids. The units for the ellipsoidal height and slant range must match the units specified by the LengthUnit property of the reference spheroid. The default length unit for the reference spheroid created by wgs84Ellipsoid is 'meter'.

wgs84 = wgs84Ellipsoid;

Specify the geodetic coordinates of the local origin. In this example, the local origin is Zermatt. Specify h0 as ellipsoidal height in meters.

lat0 = 46.017;
lon0 = 7.750;
h0 = 1673;

Specify the AER coordinates of the point of interest. In this example, the point of interest is the Matterhorn. Specify the slant range in meters.

az = 238.08;
elev = 18.744;
slantRange = 8876.8;

Then, calculate the geodetic coordinates of the Matterhorn. The result h is the ellipsoidal height of the Matterhorn in meters. To view the results in standard notation, specify the display format as shortG.

format shortG
[lat,lon,h] = aer2geodetic(az,elev,slantRange,lat0,lon0,h0,wgs84)
lat = 
       45.977

lon = 
        7.658

h = 
         4531

Reverse the transformation using the geodetic2aer function.

[az,elev,slantRange] = geodetic2aer(lat,lon,h,lat0,lon0,h0,wgs84)
az = 
       238.08

elev = 
       18.744

slantRange = 
       8876.8

Input Arguments

collapse all

Azimuth angles of one or more points in the local AER system, specified as a scalar, vector, matrix, or N-D array. Azimuths are measured clockwise from north. Specify values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Elevation angles of one or more points in the local AER system, specified as a scalar, vector, matrix, or N-D array. Specify elevations with respect to a plane that is perpendicular to the normal of the spheroid surface. If the local origin is on the surface of the spheroid (h0 = 0), then the plane is tangent to the spheroid.

Specify values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Distances from the local origin, specified as a scalar, vector, matrix, or N-D array. Specify each distance as along a straight, 3-D, Cartesian line. Specify values in units that match the LengthUnit property of the spheroid argument. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

Data Types: single | double

Geodetic latitude of the local origin, specified as a scalar, vector, matrix, or N-D array. The local origin can refer to one point or a series of points (for example, a moving platform). Specify the values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Geodetic longitude of the local origin, specified as a scalar, vector, matrix, or N-D array. The local origin can refer to one point or a series of points (for example, a moving platform). Specify the values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Ellipsoidal height of the local origin, specified as a scalar, vector, matrix, or N-D array. The local origin can refer to one point or a series of points (for example, a moving platform). Specify values in units that match the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

For more information about ellipsoidal height, see Find Ellipsoidal Height from Orthometric Height.

Data Types: single | double

Reference spheroid, specified as a referenceEllipsoid object, oblateSpheroid object, or referenceSphere object. The term reference spheroid is used synonymously with reference ellipsoid. To create a reference spheroid, use the creation function for the object. To specify the reference ellipsoid for WGS84, use the wgs84Ellipsoid function.

For more information about reference spheroids, see Comparison of Reference Spheroids.

Example: spheroid = referenceEllipsoid('GRS 80');

Angle units, specified as 'degrees' (the default) or 'radians'.

Output Arguments

collapse all

Geodetic latitude of one or more points, returned as a scalar, vector, matrix, or N-D array. Values are specified in degrees within the interval [-90 90]. To use values in radians, specify the angleUnit argument as 'radians'.

Geodetic longitude of one or more points, returned as a scalar, vector, matrix, or N-D array. Values are specified in degrees within the interval [-180 180]. To use values in radians, specify the angleUnit argument as 'radians'.

Ellipsoidal height of one or more points, returned as a scalar, vector, matrix, or N-D array. Values are specified in units that match the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

For more information about ellipsoidal height, see Find Ellipsoidal Height from Orthometric Height.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2012b

expand all