Main Content

ecef2lla

Convert Earth-centered Earth-fixed (ECEF) coordinates to geodetic coordinates

Description

example

lla = ecef2lla(ecef) converts the m-by-3 array of ECEF coordinates, ecef, to an m-by-3 array of geodetic coordinates (latitude, longitude and altitude), lla.

lla = ecef2lla(ecef,model) converts the coordinates for a specific ellipsoid planet.

lla = ecef2lla(ecef,f,Re) converts the coordinates for a custom ellipsoid planet defined by flattening, f, and the equatorial radius, Re.

Examples

collapse all

Determine latitude, longitude, and altitude at an ECEF coordinate:

lla = ecef2lla([4510731 4510731 0])
lla =

         0   45.0000  999.9564

Determine latitude, longitude, and altitude at multiple ECEF coordinates with the WGS84 ellipsoid model:

lla = ecef2lla([4510731 4510731 0; 0 4507609 4498719], 'WGS84')
lla =

         0   45.0000  999.9564
   45.1358   90.0000  999.8659

Determine latitude, longitude, and altitude at multiple coordinates with the custom ellipsoid model:

f = 1/196.877360;
Re = 3397000;
lla = ecef2lla([4510731 4510731 0; 0 4507609 4498719], f, Re)
lla =

   1.0e+06 *

         0    0.0000    2.9821
    0.0000    0.0001    2.9801

Input Arguments

collapse all

ECEF coordinates, specified as an m-by-3 array.

Data Types: double

Ellipsoid planet model, specified as 'WGS84'.

Data Types: double

Flattening at each pole, specified as a scalar.

Data Types: double

Equatorial radius, specified as a scalar in meters.

Data Types: double

Output Arguments

collapse all

Geodetic coordinates (latitude, longitude, and altitude), returned as an m-by-3 array in [degrees degrees meters].

Introduced in R2006b