Convert geodetic coordinates to Earth-centered Earth-fixed (ECEF) coordinates
p = lla2ecef(lla)
p = lla2ecef(lla, model)
p = lla2ecef(lla, f, Re)
p = lla2ecef(lla)
converts
an m
-by-3 array of geodetic coordinates (latitude,
longitude and altitude), lla
, to an m
-by-3
array of ECEF coordinates, p
. lla
is
in [degrees degrees meters]. p
is in meters. The
default ellipsoid planet is WGS84. Latitude and longitude values can
be any value. However, latitude values of +90 and -90 may return unexpected
values because of singularity at the poles.
p = lla2ecef(lla, model)
is
an alternate method for converting the coordinates for a specific
ellipsoid planet. Currently only 'WGS84'
is supported
for model
. Latitude and longitude values can be
any value. However, latitude values of +90 and -90 may return unexpected
values because of singularity at the poles.
p = lla2ecef(lla, f, Re)
is
another alternate method for converting the coordinates for a custom
ellipsoid planet defined by flattening, f
, and
the equatorial radius, Re
, in meters. Latitude
and longitude values can be any value. However, latitude values of
+90 and -90 may return unexpected values because of singularity at
the poles.
Determine ECEF coordinates at a latitude, longitude, and altitude:
p = lla2ecef([0 45 1000]) p = 1.0e+006 * 4.5107 4.5107 0
Determine ECEF coordinates at multiple latitudes, longitudes, and altitudes, specifying WGS84 ellipsoid model:
p = lla2ecef([0 45 1000; 45 90 2000], 'WGS84') p = 1.0e+006 * 4.5107 4.5107 0 0.0000 4.5190 4.4888
Determine ECEF coordinates at multiple latitudes, longitudes, and altitudes, specifying custom ellipsoid model:
f = 1/196.877360; Re = 3397000; p = lla2ecef([0 45 1000; 45 90 2000], f, Re) p = 1.0e+006 * 2.4027 2.4027 0 0.0000 2.4096 2.3852