Skip to content

Geodetic

Geodetic (WGS84 ellipsoid) coordinate transformations.

Converts between geodetic coordinates [longitude, latitude, altitude] and Earth-Centered Earth-Fixed (ECEF) Cartesian coordinates [x, y, z].

The geodetic model uses the WGS84 reference ellipsoid, which accounts for Earth's oblateness. The forward transformation is closed-form; the inverse uses Bowring's iterative method implemented with jax.lax.while_loop for JAX traceability.

All inputs and outputs use SI base units (metres, radians).

References
  1. NIMA Technical Report TR8350.2, Department of Defense World Geodetic System 1984.
  2. O. Montenbruck and E. Gill, Satellite Orbits: Models, Methods and Applications, Springer, 2012, Sec. 5.3.

position_ecef_to_geodetic(x_ecef, use_degrees=False)

Convert ECEF Cartesian coordinates to geodetic position.

Uses Bowring's iterative method with convergence controlled by jax.lax.while_loop (max 10 iterations). The convergence threshold is scaled to the configured float dtype precision.

Parameters:

Name Type Description Default
x_ecef ArrayLike

ECEF position [x, y, z] in m.

required
use_degrees bool

If True, return longitude and latitude in degrees.

False

Returns:

Type Description
Array

Geodetic coordinates [lon, lat, alt]. Longitude and latitude in rad (or deg), altitude in m above the WGS84 ellipsoid.

Examples:

import jax.numpy as jnp
from astrojax.constants import WGS84_a
from astrojax.coordinates import position_ecef_to_geodetic
x_ecef = jnp.array([WGS84_a, 0.0, 0.0])
geod = position_ecef_to_geodetic(x_ecef)
float(geod[2])  # altitude ≈ 0

position_geodetic_to_ecef(x_geod, use_degrees=False)

Convert geodetic position to ECEF Cartesian coordinates.

Uses the WGS84 prime vertical radius of curvature:

.. math::

N = \frac{a}{\sqrt{1 - e^2 \sin^2 \phi}}

Parameters:

Name Type Description Default
x_geod ArrayLike

Geodetic coordinates [lon, lat, alt]. Longitude and latitude in rad (or deg if use_degrees=True), altitude in m above the WGS84 ellipsoid.

required
use_degrees bool

If True, interpret longitude and latitude as degrees.

False

Returns:

Type Description
Array

ECEF position [x, y, z] in m.

Examples:

import jax.numpy as jnp
from astrojax.coordinates import position_geodetic_to_ecef
x_geod = jnp.array([0.0, 0.0, 0.0])
x_ecef = position_geodetic_to_ecef(x_geod)
float(x_ecef[0])  # WGS84_a on the equator