Function File: lat, lon, alt = ecef2geodetic (spheroid, X, Y, Z)
Function File: lat, lon, alt = ecef2geodetic (X, Y, Z)
Function File: lat, lon, alt = ecef2geodetic (…, angleUnit)
Function File: lat, lon, alt = ecef2geodetic (X, Y, Z, spheroid)

Convert from Earth Centered Earth Fixed (ECEF) coordinates to geodetic coordinates.

Inputs:

  • spheroid can be a referenceEllipsoid name or struct (see help for referenceEllipsoid.m). Unfortunately an EPSG number as first argument input as a numeric value cannot be accepted UNLESS ecef2geodetic is called with five (5) input arguments. Rather input the number as a character string (between quotes). If omitted or if an empty string or empty array (’[]’) is supplied the WGS84 ellipsoid (EPSG 7030) will be selected.

    Inputting spheroid as 4th argument is accepted but not recommended; in that case the lat and lon outputs are returned in radians.

  • X, Y and Z (length) are Earth-Centered Earth Fixed coordinates. They can be scalars, vectors or matrices but they must all have the same size and dimensions. Their length unit is that of the used reference ellipsoid, whose default is meters.

Outputs:

  • lat, lon, alt: geodetic coordinates (angle, angle, length). The default output is in degrees unless spheroid is specified as 4th argument (see above), or if "radians" is specified for optional last argument angleUnit. The geodetic height’s (alt) length unit equals that of the used reference ellipsoid, whose default is meters. The size and dimension(s) of lat, lon and alt are the same as X, Y and Z.

    Note: 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.

Example:

Aalborg GPS Centre
X =     3426949.39675307
Y =     601195.852419885
Z =     5327723.99358255
lat = 57.02929569;
lon = 9.950248114;
h = 56.95; # meters

>> [lat, lon, alt] = geodetic2ecef ("", X, Y, Z)
lat = 57.029
lon = 9.9502
alt = 56.95

See also: geodetic2ecef, ecef2aer, ecef2enu, ecef2enuv,ecef2ned, ecef2nedv, egm96geoid, referenceEllipsoid.

Package: mapping