Main Content

ecef2lla

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

Description

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. Units are in meters.

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.

example

Examples

collapse all

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

lla = ecef2lla([4510731 4510731 0])
lla = 1×3

         0   45.0000  999.9564

Determine latitude, longitude, and altitude at multiple ECEF coordinates, specifying the WGS84 ellipsoid model.

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

         0   45.0000  999.9564
   45.1358   90.0000  999.8659

Determine latitude, longitude, and altitude at multiple coordinates, specifying the custom ellipsoid model.

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

         0    0.0000    2.9821
    0.0000    0.0001    2.9801

Input Arguments

collapse all

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

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]. Latitude and longitude can be any value. Altitude is above the planetary ellipsoid.

Version History

Introduced in R2006b