geodetic2aer

Geodetic to local spherical AER

Syntax

• ```[az,elev,slantRange] = geodetic2aer(lat,lon,h,lat0,lon0,h0,spheroid)``` example
• `[___] = geodetic2aer(___,angleUnit)`

Description

example

``````[az,elev,slantRange] = geodetic2aer(lat,lon,h,lat0,lon0,h0,spheroid)``` returns coordinates in a local spherical system corresponding to geodetic coordinates `lat`, `lon`, `h`. `spheroid` is an instance of a reference spheroid object. Any of the first six numeric input arguments can be scalar, even when the others are nonscalar; but all nonscalar numeric arguments must match in size.```
````[___] = geodetic2aer(___,angleUnit)` adds `angleUnit` which specifies the units of inputs `lat`, `lon`, `lat0`, `lon0`, and outputs `az`, `elev`.```

Examples

collapse all

Zermatt to the Matterhorn

Compute the azimuth (in degrees), elevation angle (in degrees), and line of sight distance from Zermatt, Switzerland to the summit of the Matterhorn (Monte Cervino). All distances and lengths are in meters.

Origin (reference point): Zermatt.

```fmt = get(0,'Format'); format short g lat0 = dm2degrees([46 1]) % convert degree-minutes to degrees lon0 = dm2degrees([ 7 45]) hOrthometric0 = 1620; hGeoid = 53; h0 = hOrthometric0 + hGeoid```
```lat0 = 46.017 lon0 = 7.75 h0 = 1673```

Point of Interest: Summit of Matterhorn.

```lat = dms2degrees([45 58 35]) lon = dms2degrees([ 7 39 30]) hOrthometric = 4478; hGeoid = 53; h = hOrthometric + hGeoid ```
```lat = 45.976 lon = 7.6583 h = 4531```

Azimuth, elevation angle, and slant range (line of sight distance) from Zermatt to Matterhorn summit.

```spheroid = referenceEllipsoid('WGS 84') [az,elev,slantRange] = geodetic2aer( ... lat,lon,h,lat0,lon0,h0,spheroid) format(fmt) ```
```spheroid = referenceEllipsoid with defining properties: Code: 7030 Name: 'World Geodetic System 1984' LengthUnit: 'meter' SemimajorAxis: 6378137 SemiminorAxis: 6356752.31424518 InverseFlattening: 298.257223563 Eccentricity: 0.0818191908426215 and additional properties: Flattening ThirdFlattening MeanRadius SurfaceArea Volume az = 237.8 elev = 18.755 slantRange = 8871.7```

Input Arguments

collapse all

`lat` — Geodetic latitudesscalar value | vector | matrix | N-D array

Geodetic latitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the input argument `angleUnit`, if supplied, and in degrees, otherwise.

Data Types: `single` | `double`

`lon` — Longitudesscalar value | vector | matrix | N-D array

Longitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the input argument `angleUnit`, if supplied, and in degrees, otherwise.

Data Types: `single` | `double`

`h` — Ellipsoidal heightsscalar value | vector | matrix | N-D array

Ellipsoidal heights of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the `LengthUnit` property of the `spheroid` object.

Data Types: `single` | `double`

`lat0` — Geodetic latitude of local originscalar value | vector | matrix | N-D array

Geodetic latitude of local origin (reference) point(s), specified as a scalar value, vector, matrix, or N-D array. In many cases there is one origin (reference) point, and the value of `lat0` is scalar, but it need not be. (It may refer to a moving platform, for example). Values must be in units that match the input argument `angleUnit`, if supplied, and in degrees, otherwise.

Data Types: `single` | `double`

`lon0` — Longitude of local originscalar value | vector | matrix | N-D array

Longitude of local origin (reference) point(s), specified as a scalar value, vector, matrix, or N-D array. In many cases there is one origin (reference) point, and the value of `lon0` is scalar, but it need not be. (It may refer to a moving platform, for example). Values must be in units that match the input argument `angleUnit`, if supplied, and in degrees, otherwise.

Data Types: `single` | `double`

`h0` — Ellipsoidal height of local originscalar value | vector | matrix | N-D array

Ellipsoidal height of local origin (reference) point(s), specified as a scalar value, vector, matrix, or N-D array. In many cases there is one origin (reference) point, and the value of `h0` is scalar, but it need not be. (It may refer to a moving platform, for example). Units are determined by the `LengthUnit` property of the spheroid input.

Data Types: `single` | `double`

`spheroid` — Reference spheroidreferenceEllipsoid | oblateSpheroid | referenceSphere

Reference spheroid, specified as a referenceEllipsoid, oblateSpheroid, or referenceSphere object. Use the constructor for one of these three classes, or the `wgs84Ellipsoid` function, to construct a Mapping Toolbox spheroid object. You can not directly pass in a string that names your spheroid. Instead, pass that string to `referenceEllipsoid` or `referenceSphere` and use the resulting object.

`angleUnit` — Units of angles`'degrees'` (default) | `'radians'`

Units of angles, specified as ‘degrees' (default), or 'radians'.

Data Types: `char`

Output Arguments

collapse all

`az` — Azimuth anglesscalar value | vector | matrix | N-D array

Azimuth angles in the local spherical system, returned as a scalar value, vector, matrix, or N-D array. Azimuths are measured clockwise from north. Units are determined by the input argument `angleUnit`, if supplied; values are in degrees, otherwise. When in degrees, they lie in the half-open interval [0 360).

`elev` — Elevation anglesscalar value | vector | matrix | N-D array

Elevation angles in the local spherical system, returned as a scalar value, vector, matrix, or N-D array. Elevations are with respect to a plane perpendicular to the spheroid surface normal. Units determined by the input argument `angleUnit`, if supplied; values are in degrees, otherwise. When in degrees, they lie in the closed interval [-90 90].

`slantRange` — Distances from local originscalar value | vector | matrix | N-D array

Distances from origin in the local spherical system, returned as a scalar value, vector, matrix, or N-D array. The straight-line, 3-D Cartesian distance is computed. Units are determined by the `LengthUnit` property of the `spheroid` input.