Modules | Functions
Coordinate systems
Collaboration diagram for Coordinate systems:

Modules

 WGS84 Parameters

Functions

static void ecef2ned_matrix (const double ref_ecef[3], double M[3][3])
void llhdeg2rad (const double llg_deg[3], double llh_rad[3])
void llhrad2deg (const double llh_rad[3], double llh_deg[3])
void wgsecef2azel (const double ecef[3], const double ref_ecef[3], double *azimuth, double *elevation)
void wgsecef2llh (const double ecef[3], double llh[3])
void wgsecef2ned (const double ecef[3], const double ref_ecef[3], double ned[3])
void wgsecef2ned_d (const double ecef[3], const double ref_ecef[3], double ned[3])
void wgsllh2ecef (const double llh[3], double ecef[3])
void wgsned2ecef (const double ned[3], const double ref_ecef[3], double ecef[3])
void wgsned2ecef_d (const double ned[3], const double ref_ecef[3], double ecef[3])

Detailed Description

Functions used for converting between various coordinate systems. References:

  1. NIMA Technical Report TR8350.2, "Department of Defense World Geodetic System 1984, Its Definition and Relationships With Local Geodetic Systems", Third Edition
  2. WGS84 Implementation Manual, Eurocontrol, Version 2.4.
  3. Datum Transformations of GPS Positions, Application Note, u-blox ag.
  4. Geodetic system. In Wikipedia, The Free Encyclopedia. Retrieved 00:47, March 26, 2012.

Function Documentation

static void ecef2ned_matrix ( const double  ref_ecef[3],
double  M[3][3] 
) [static]

Helper function which populates a provided 3x3 matrix with the appropriate rotation matrix to transform from ECEF to NED coordinates, given the provided ECEF reference vector.

Parameters:
ref_ecefCartesian coordinates of reference vector, passed as [X, Y, Z], all in meters.
M3x3 matrix to be populated with rotation matrix.

Definition at line 228 of file coord_system.c.

void llhdeg2rad ( const double  llg_deg[3],
double  llh_rad[3] 
)

Converts from an LLH coordinate in decimal degrees into a LLH coordinate in radians.

Conversion from degrees to radians is done using a simple direct conversion formula: $radians = {degrees * }{180}$

Safe to pass same pointer as input and output value, eg: llhdeg2rad(arr1, arr1);

Definition at line 63 of file coord_system.c.

void llhrad2deg ( const double  llh_rad[3],
double  llh_deg[3] 
)

Converts from an LLH coordinate in radians into a LLH coordinate in decimal degrees

Conversion from radians to degrees is done using a simple direct conversion formula: $degrees = {radians *` 180}{}$

Safe to pass same pointer as input and output value, eg: llhrad2deg(arr1, arr1);

Definition at line 45 of file coord_system.c.

void wgsecef2azel ( const double  ecef[3],
const double  ref_ecef[3],
double *  azimuth,
double *  elevation 
)

Determine the azimuth and elevation of a point in WGS84 Earth Centered, Earth Fixed (ECEF) Cartesian coordinates from a reference point given in WGS84 ECEF coordinates.

First the vector between the points is converted into the local North, East, Down frame of the reference point. Then we can directly calculate the azimuth and elevation.

Parameters:
ecefCartesian coordinates of the point, passed as [X, Y, Z], all in meters.
ref_ecefCartesian coordinates of the reference point from which the azimuth and elevation is to be determined, passed as [X, Y, Z], all in meters.
azimuthPointer to where to store the calculated azimuth output.
elevationPointer to where to store the calculated elevation output.

Definition at line 362 of file coord_system.c.

void wgsecef2llh ( const double  ecef[3],
double  llh[3] 
)

Converts from WGS84 Earth Centered, Earth Fixed (ECEF) Cartesian coordinates (X, Y and Z) into WGS84 geodetic coordinates (latitude, longitude and height).

Conversion from Cartesian to geodetic coordinates is a much harder problem than conversion from geodetic to Cartesian. There is no satisfactory closed form solution but many different iterative approaches exist.

Here we implement a relatively new algorithm due to Fukushima (2006) that is very computationally efficient, not requiring any transcendental function calls during iteration and very few divisions. It also exhibits cubic convergence rates compared to the quadratic rate of convergence seen with the more common algortihms based on the Newton-Raphson method.

References:

  1. "A comparison of methods used in rectangular to Geodetic Coordinates Transformations", Burtch R. R. (2006), American Congress for Surveying and Mapping Annual Conference. Orlando, Florida.
  2. "Transformation from Cartesian to Geodetic Coordinates Accelerated by Halley’s Method", T. Fukushima (2006), Journal of Geodesy.
Parameters:
ecefCartesian coordinates to be converted, passed as [X, Y, Z], all in meters.
llhConverted geodetic coordinates are written into this array as [lat, lon, height] in [radians, radians, meters].

Definition at line 128 of file coord_system.c.

void wgsecef2ned ( const double  ecef[3],
const double  ref_ecef[3],
double  ned[3] 
)

Converts a vector in WGS84 Earth Centered, Earth Fixed (ECEF) Cartesian coordinates to the local North, East, Down (NED) frame of a reference point, also given in WGS84 ECEF coordinates.

Note, this function only rotates the ECEF vector into the NED frame of the reference point, as would be appropriate for e.g. a velocity vector. To determine the distance between the point and the reference point in the NED frame of the reference point, see wgsecef2ned_d.

See also:
wgsecef2ned_d.
Parameters:
ecefCartesian coordinates of the point, passed as [X, Y, Z], all in meters.
ref_ecefCartesian coordinates of the reference point, passed as [X, Y, Z], all in meters.
nedThe North, East, Down vector is written into this array as [N, E, D], all in meters.

Definition at line 270 of file coord_system.c.

void wgsecef2ned_d ( const double  ecef[3],
const double  ref_ecef[3],
double  ned[3] 
)

Returns the vector to a point given in WGS84 Earth Centered, Earth Fixed (ECEF) Cartesian coordinates from a reference point, also given in WGS84 ECEF coordinates, in the local North, East, Down (NED) frame of the reference point.

See also:
wgsecef2ned.
Parameters:
ecefCartesian coordinates of the point, passed as [X, Y, Z], all in meters.
ref_ecefCartesian coordinates of the reference point, passed as [X, Y, Z], all in meters.
nedThe North, East, Down vector is written into this array as [N, E, D], all in meters.

Definition at line 292 of file coord_system.c.

void wgsllh2ecef ( const double  llh[3],
double  ecef[3] 
)

Converts from WGS84 geodetic coordinates (latitude, longitude and height) into WGS84 Earth Centered, Earth Fixed Cartesian (ECEF) coordinates (X, Y and Z).

Conversion from geodetic coordinates latitude, longitude and height $(\phi, \lambda, h)$ into Cartesian coordinates $(X, Y, Z)$ can be achieved with the following formulae:

\[ X = (N(\phi) + h) \cos{\phi}\cos{\lambda} \]

\[ Y = (N(\phi) + h) \cos{\phi}\sin{\lambda} \]

\[ Z = \left[(1-e^2)N(\phi) + h\right] \sin{\phi} \]

Where the 'radius of curvature', $ N(\phi) $, is defined as:

\[ N(\phi) = \frac{a}{\sqrt{1-e^2\sin^2 \phi}} \]

and $ a $ is the WGS84 semi-major axis and $ e $ is the WGS84 eccentricity. See WGS84 Parameters.

Parameters:
llhGeodetic coordinates to be converted, passed as [lat, lon, height] in [radians, radians, meters].
ecefConverted Cartesian coordinates are written into this array as [X, Y, Z], all in meters.

Definition at line 93 of file coord_system.c.

void wgsned2ecef ( const double  ned[3],
const double  ref_ecef[3],
double  ecef[3] 
)

Converts a vector in local North, East, Down (NED) coordinates relative to a reference point given in WGS84 Earth Centered, Earth Fixed (ECEF) Cartesian coordinates to a vector in WGS84 ECEF coordinates.

Note, this function only rotates the NED vector into the ECEF frame, as would be appropriate for e.g. a velocity vector. To pass an NED position in the reference frame of the NED, see wgsned2ecef_d.

See also:
wgsned2ecef_d.
Parameters:
nedThe North, East, Down vector is passed as [N, E, D], all in meters.
ref_ecefCartesian coordinates of the reference point, passed as [X, Y, Z], all in meters.
ecefCartesian coordinates of the point written into this array, [X, Y, Z], all in meters.

Definition at line 317 of file coord_system.c.

void wgsned2ecef_d ( const double  ned[3],
const double  ref_ecef[3],
double  ecef[3] 
)

For a point given in the local North, East, Down (NED) frame of a provided ECEF reference point, return the vector to that point in ECEF coordinates.

Intended for calculating a new ECEF position. For converting velocity vectors,

See also:
wgsned2ecef.
Parameters:
nedThe North, East, Down vector is passed as [N, E, D], all in meters.
ref_ecefCartesian coordinates of the reference point, passed as [X, Y, Z], all in meters.
ecefCartesian coordinates of the point written into this array, [X, Y, Z], all in meters.

Definition at line 338 of file coord_system.c.



swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:57:01