Function File: e, n, u = geodetic2enu (lat, lon, alt, lat0, lon0, alt0)
Function File: e, n, u = geodetic2enu (lat, lon, alt, lat0, lon0, alt0, spheroid)
Function File: e, n, u = geodetic2enu (lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit)

Convert from geodetic coordinates to local East, North, Up (ENU) coordinates.

Inputs:

  • lat, lon, alt: ellipsoid geodetic coordinates of target point (angle, angle, length). Can be scalars but vectors and nD arrays values are accepted if they have equal dimensions.
  • lat0, lon0, alt0: ellipsoid geodetic coordinates of observer location (angle, angle, length). In case of multiple observer locations their numbers and dimensions should match those of the target points (i.e., one observer location for each target point). The length units of target point(s) and observer location(s) should match.

    Note: alt (height) is relative to the reference ellipsoid, not the geoid. Use e.g., egm96geoid to compute the height difference between the geoid and the WGS84 reference ellipsoid.

  • spheroid (optional): a user-specified sheroid (see referenceEllipsoid); it can be omitted or given as an empty string or empty numeric array(’[]’), in which cases WGS84 will be selected as default spheroid.

    angleUnit: string for angular units (’degrees’ or ’radians’, case-insensitive, just the first character will do). Default is ’degrees’.

Outputs:

  • e, n, u: East, North, Up Cartesian coordinates (length).

Lengh units are those of the invoked reference ellipsoid (see below).

Example:

lat  = 42.002; lon  = -81.998; alt  = 1000;
lat0 = 42;     lon0 = -82;     alt0 = 200;
[e, n, u] = geodetic2enu(lat, lon, alt, lat0, lon0, alt0, "wgs84", "degrees")
e =  165.72
n =  222.18
u =  799.99

See also: enu2geodetic, geodetic2aer, geodetic2ecef, geodetic2ned, egm96geoid, referenceEllipsoid.

Package: mapping