# enu2aer

Transform local east-north-up coordinates to local spherical

## Syntax

``````[az,elev,slantRange] = enu2aer(xEast,yNorth,zUp)``````
``[___] = enu2aer(___,angleUnit)``

## Description

example

``````[az,elev,slantRange] = enu2aer(xEast,yNorth,zUp)``` transforms the local east-north-up (ENU) Cartesian coordinates specified by `xEast`, `yNorth`, and `zUp` to the local azimuth-elevation-range (AER) spherical coordinates specified by `az`, `elev`, and `slantRange`. Both coordinate systems use the same local origin. Each input argument must match the others in size or be scalar. ```
````[___] = enu2aer(___,angleUnit)` specifies the units for azimuth and elevation. Specify `angleUnit` as `'degrees'` (the default) or `'radians'`.```

## Examples

collapse all

Find the AER coordinates of a ground vehicle with respect to a parking gate, using the ENU coordinates of the vehicle with respect to the same gate.

First, specify the ENU coordinates of the vehicle. For this example, specify the coordinates in meters.

```xEast = 8.4504; yNorth = 12.4737; zUp = 1.1046;```

Then, calculate the AER coordinates of the vehicle. The azimuth and elevation are specified in degrees. The units for the slant range match the units specified by the ENU coordinates. Thus, the slant range is specified in meters.

`[az,elev,slantRange] = enu2aer(xEast,yNorth,zUp)`
```az = 34.1160 ```
```elev = 4.1931 ```
```slantRange = 15.1070 ```

Reverse the transformation using the `aer2enu` function.

`[xEast,yNorth,zUp] = aer2enu(az,elev,slantRange)`
```xEast = 8.4504 ```
```yNorth = 12.4737 ```
```zUp = 1.1046 ```

## Input Arguments

collapse all

ENU x-coordinates of one or more points in the local ENU system, specified as a scalar, vector, matrix, or N-D array.

Data Types: `single` | `double`

ENU y-coordinates of one or more points in the local ENU system, specified as a scalar, vector, matrix, or N-D array.

Data Types: `single` | `double`

ENU z-coordinates of one or more points in the local ENU system, specified as a scalar, vector, matrix, or N-D array.

Data Types: `single` | `double`

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

## Output Arguments

collapse all

Azimuth angles of one or more points in the local AER system, returned as a scalar, vector, matrix, or N-D array. Azimuths are measured clockwise from north. Values are specified in degrees within the half-open interval [0 360). To use values in radians, specify the `angleUnit` argument as `'radians'`.

Elevation angles of one or more points in the local AER system, returned as a scalar, vector, matrix, or N-D array. Elevations are calculated with respect to the `xEast`-`yNorth` plane that contains the local origin. If the local origin is on the surface of the spheroid, then the `xEast`-`yNorth` plane is tangent to the spheroid.

Values are specified in degrees within the closed interval [-90 90]. Positive elevations correspond to positive `zUp` values, and negative elevations correspond to negative `zUp` values. An elevation of 0 indicates that the point lies in the `xEast`-`yNorth` plane. To use values in radians, specify the `angleUnit` argument as `'radians'`.

Distances from the local origin, returned as a scalar, vector, matrix, or N-D array. Each distance is calculated along a straight, 3-D, Cartesian line. Values are returned in the units specified by `xEast`, `yNorth`, and `zUp`.

## Version History

Introduced in R2012b

expand all