GPS and ECEF Converter

Table of Contents

To convert GPS coordinates (latitude, longitude, elevation) to rectangular (Cartesian) coordinates, you need to account for Earth's ellipsoidal shape using the WGS 84 parameters. This conversion is often called ECEF (Earth-Centered, Earth-Fixed) coordinates. Here is how to do it:

GPS Coordinates

Geographic coordinates (latitude/longitude) use angular measurements:

ECEF (Earth-Centered Earth-Fixed) Coordinates

A Cartesian system (X,Y,Z) with origin at Earth's center:

GPS and ECEF coordinates

Key Formulas (WGS 84 Ellipsoid)

The conversion uses the following parameters: For a point with:

Example

Example: \( 40.6892^\circ \text{N}, -74.0445^\circ \text{W}, h = 93 \, \text{m} \).
  1. Calculate \( N \): \[ N = \dfrac{6,378,137}{\sqrt{1 - 0.00669438 \sin^2(40.6892^\circ))}} \approx 6,387,203.25 \, \text{m} \]
  2. Compute \( X, Y, Z \): \[ \begin{align*} X &= (6,387,203.25 + 93) \cos(40.6892^\circ) \cos(-74.0445^\circ) \approx 1,331,915 \, \text{m} \\ Y &= (6,387,203.25 + 93) \cos(40.6892^\circ) \sin(-74.0445^\circ) \approx -4,652,103 \, \text{m} \\ Z &= \left(6,387,203.25 \times (1 - 0.00669438) + 93\right) \sin(40.6892^\circ) \approx 4,164,962 \, \text{m} \\ \end{align*} \]

The ECEF coordinates are used:

GPS and ECEF to and from Converter

A converter between geographic (latitude/longitude/height) and Earth-Centered Earth-Fixed (ECEF) coordinates is presented below

LLH to ECEF Converter

ECEF to LLH Converter