geodetic2ecef

Class: oblateSpheroid

Transform geodetic to geocentric (ECEF) coordinates

Syntax

[X,Y,Z] = geodetic2ecef(spheroid,lat,lon,h)
[X,Y,Z] = geodetic2ecef(___, angleUnit)

Description

[X,Y,Z] = geodetic2ecef(spheroid,lat,lon,h) returns Earth-Centered Earth-Fixed (ECEF) spheroid-centric Cartesian coordinates corresponding to geodetic coordinates lat, lon, h. Any of the three numerical arguments can be scalar, even when the others are nonscalar; but all nonscalar numeric arguments must match in size.

[X,Y,Z] = geodetic2ecef(___, angleUnit) adds angleUnit which specifies the units of inputs lat and lon.

Input Arguments

expand all

spheroid — Reference spheroidscalar referenceEllipsoid | oblateSpheroid | referenceSphere object

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

lat — Geodetic latitudesscalar value | vector | matrix | N-D array

Geodetic latitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the input argument angleUnit, if supplied, and in degrees, otherwise.

Data Types: single | double

lon — Longitudesscalar value | vector | matrix | N-D array

Longitudes of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the input argument angleUnit, if supplied, and in degrees, otherwise.

Data Types: single | double

h — Ellipsoidal heightsscalar value | vector | matrix | N-D array

Ellipsoidal heights of one or more points, specified as a scalar value, vector, matrix, or N-D array. Values must be in units that match the LengthUnit property of the spheroid object.

Data Types: single | double

angleUnit — Units of angles'degrees' (default) | 'radians'

Units of angles, specified as ‘degrees' (default), or 'radians'.

Data Types: char

Output Arguments

expand all

X — ECEF x-coordinatesscalar value | vector | matrix | N-D array

x-coordinates of one or more points in the spheroid-centric ECEF system, returned as a scalar value, vector, matrix, or N-D array. Units are determined by the LengthUnit property of the spheroid object.

Y — ECEF y-coordinatesscalar value | vector | matrix | N-D array

y-coordinates of one or more points in the spheroid-centric ECEF system, returned as a scalar value, vector, matrix, or N-D array. Units are determined by the LengthUnit property of the spheroid object.

Z — ECEF y-coordinatesscalar value | vector | matrix | N-D array

z-coordinates of one or more points in the spheroid-centric ECEF system, returned as a scalar value, vector, matrix, or N-D array. Units are determined by the LengthUnit property of the spheroid object.

Was this topic helpful?