Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

ecef2geodetic

Transform geocentric (ECEF) to geodetic coordinates

Syntax

  • [lat,lon,h] = ecef2geodetic(spheroid,x,y,z)
    example
  • [lat,lon,h] = ecef2geodetic(___,angleUnit)
  • [lat,lon,h] = geodetic2ecef(x,y,z,spheroid)

Description

example

[lat,lon,h] = ecef2geodetic(spheroid,x,y,z) transforms point locations in geocentric Earth-Centered Earth-Fixed (ECEF) Cartesian coordinates, stored in the coordinate arrays X, Y, and Z, to geodetic coordinates lat (geodetic latitude), lon (longitude), and h (ellipsoidal height). The geodetic coordinates refer to the reference body specified by the spheroid object, spheroid.

[lat,lon,h] = ecef2geodetic(___,angleUnit) uses the character vector angleUnit, which matches either 'degrees' or 'radians', to specify the units of the latitude and longitude coordinates.

[lat,lon,h] = geodetic2ecef(x,y,z,spheroid) This syntax is supported but not recommended. This syntax returns lat and lon in radians. spheroid can be either a spheroid or an ellipsoid vector of the form: [semimajor_axis, eccentricity]. X, Y, and Z must use the same units as the semimajor axis. In this case, H must use the same units as the semimajor axis.

Examples

collapse all

Convert the geocentric Earth-Centered Earth-Fixed (ECEF) Cartesian coordinates for Paris, France into geodetic coordinates (latitude,longitude).

x =   4.2010e+06;
y =   1.7246e+05;
z =   4.7801e+06;
wgs84 = wgs84Ellipsoid('meters');
[lat,lon,h] = ecef2geodetic(wgs84,x,y,z)
lat =

   48.8562


lon =

    2.3508


h =

   67.3700

Input Arguments

collapse all

Reference body, specified as a spheroid object: oblateSpheroid, referenceEllipsoid, or referenceSphere.

Geocentric Earth-Centered Earth-Fixed Cartesian X coordinates, specified as a numeric array.

Data Types: single | double

Geocentric Earth-Centered Earth-Fixed Cartesian Ycoordinates, returned as a numeric array.

Data Types: single | double

Geocentric Earth-Centered Earth-Fixed Cartesian Z coordinates, specified as a numeric array.

Example:

Data Types: single | double

Units of the latitude and longitude coordinates, specified as the character vector 'degrees' or 'radians'.

Data Types: char

Output Arguments

collapse all

Geodetic latitude in degrees, returned as geodetic coordinate array.

Geodetic longitude in degrees, returned as a geodetic coordinate array.

Ellipsoidal height, returned as a numeric array. h is expressed in the same unit of length as the spheroid.

More About

collapse all

Tips

  • The geocentric Cartesian (ECEF) coordinate system is fixed with respect to the Earth, with its origin at the center of the spheroid and its positive X-, Y-, and Z axes intersecting the surface at the following points:

     LatitudeLongitude Notes
    X-axis00Equator at the Prime Meridian
    Y-axis090Equator at 90-degrees East
    Z-zxis900North Pole

Introduced in R2012b

Was this topic helpful?