Convert geodetic to geocentric (ECEF) coordinates


[x,y,z] = geodetic2ecef(phi,lambda,h,ellipsoid)


[x,y,z] = geodetic2ecef(phi,lambda,h,ellipsoid) converts geodetic point locations specified by the coordinate arrays phi (geodetic latitude in radians), lambda (longitude in radians), and h (ellipsoidal height) to geocentric Cartesian coordinates x, y, and z. ellipsoid is a referenceEllipsoid (oblateSpheroid) object, a referenceSphere object, or a vector of the form [semimajor axis, eccentricity]. h must use the same units as the semimajor axis; x, y, and z will be expressed in these units, also.


The geocentric Cartesian coordinate system is fixed with respect to the Earth, with its origin at the center of the ellipsoid and its x-, y-, and z-axes intersecting the surface at the locations listed in the table below.

AxisLatitude where axis intersects surface Longitude where axis intersects surfaceDescription
x00Equator/Prime Meridian
y090º EEquator/90º E meridian
z90º NNANorth Pole

A common synonym is Earth-Centered, Earth-Fixed coordinates, or ECEF.

Was this topic helpful?