ecefOffset

Cartesian ECEF offset between geodetic coordinates

Description

example

[deltaX,deltaY,deltaZ] = ecefOffset(spheroid,lat1,lon1,h1,lat2,lon2,h2) returns the Earth-Centered Earth-Fixed (ECEF) Cartesian offset between the geodetic coordinates specified by lat1, lon1, and h1 and the coordinates specified by lat2, lon2, and h2. Specify spheroid as the reference spheroid for the geodetic coordinates.

[] = ecefOffset(___,angleUnit), where angleUnit is 'radians', specifies the units for latitude and longitude as radians. If you do not specify an angle unit, then latitude and longitude are in degrees.

Examples

collapse all

Find the ECEF offset between Paris, France and Miami, Florida.

First, specify the reference spheroid as WGS 84. For more information about WGS84, see Reference Spheroids. The units for the ellipsoidal height and offset vector must match the units specified by the LengthUnit property of the reference spheroid. The default length unit for the reference spheroid created by wgs84Ellipsoid is 'meter'.

wgs84 = wgs84Ellipsoid;

Specify the geodetic coordinates of Paris and Miami. Specify hParis and hMiami as ellipsoidal height in meters. The value of hMiami is negative because Miami is below the surface of the reference spheroid.

latParis = 48.8567;
lonParis = 2.3508;
hParis = 80;

latMiami = 25.7753;
lonMiami = -80.2089;
hMiami = -25;

Calculate the ECEF offset between the two geodetic positions. The values dx, dy, and dz are specified in meters. For this example, the results display in scientific notation.

[dx,dy,dz] = ecefOffset(wgs84,latParis,lonParis,hParis,latMiami,lonMiami,hMiami)
dx = -3.2236e+06
dy = -5.8359e+06
dz = -2.0235e+06

Calculate the straight-line, 3-D Cartesian distance from Paris to Miami.

d = norm([dx dy dz])
d = 6.9674e+06

Input Arguments

collapse all

Reference spheroid, specified as a referenceEllipsoid object, oblateSpheroid object, or referenceSphere object. The term reference spheroid is used synonymously with reference ellipsoid. To create a reference spheroid, use the creation function for the object. To specify the reference ellipsoid for WGS84, use the wgs84Ellipsoid function.

For more information about reference spheroids, see Reference Spheroids.

Example: spheroid = referenceEllipsoid('GRS 80');

Geodetic latitude of one or more points, specified as a scalar or vector. Specify the values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Geodetic longitude of one or more points, specified as a scalar or vector. Specify the values in degrees. To use values in radians, specify the angleUnit argument as 'radians'.

Data Types: single | double

Ellipsoidal height of one or more points, specified as a scalar or vector. Specify values in units that match the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

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

Data Types: char

Output Arguments

collapse all

ECEF offset in the x-axis direction, returned as a scalar or vector. Units are specified by the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

ECEF offset in the y-axis direction, returned as a scalar or vector. Units are specified by the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

ECEF offset in the z-axis direction, returned as a scalar or vector. Units are specified by the LengthUnit property of the spheroid object. For example, the default length unit for the reference ellipsoid created by wgs84Ellipsoid is 'meter'.

Introduced in R2012b