Skip to content

Keplerian

Keplerian orbital element ↔ ECI Cartesian state vector conversions.

Converts between osculating Keplerian orbital elements [a, e, i, RAAN, omega, M] and inertial Cartesian state vectors [x, y, z, vx, vy, vz].

Element ordering follows the Brahe convention:

Index Element Units
0 a — semi-major axis m
1 e — eccentricity dimensionless
2 i — inclination rad
3 Ω — right ascension (RAAN) rad
4 ω — argument of perigee rad
5 M — mean anomaly rad

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

References
  1. O. Montenbruck and E. Gill, Satellite Orbits: Models, Methods and Applications, Springer, 2012, Sec. 2.2.

state_eci_to_koe(x_cart, use_degrees=False)

Convert an ECI Cartesian state vector to Keplerian orbital elements.

Derives the osculating elements from position and velocity using angular momentum, vis-viva, and the node/eccentricity vectors (Montenbruck & Gill Eq. 2.56–2.68).

Parameters:

Name Type Description Default
x_cart ArrayLike

ECI state [x, y, z, vx, vy, vz] in m and m/s.

required
use_degrees bool

If True, return angular elements in degrees.

False

Returns:

Type Description
Array

Orbital elements [a, e, i, RAAN, omega, M]. Semi-major axis in m, angles in rad (or deg).

Examples:

import jax.numpy as jnp
from astrojax.constants import R_EARTH, GM_EARTH
from astrojax.coordinates import state_eci_to_koe
sma = R_EARTH + 500e3
v_circ = jnp.sqrt(GM_EARTH / sma)
state = jnp.array([sma, 0.0, 0.0, 0.0, v_circ, 0.0])
oe = state_eci_to_koe(state)
oe.shape
References

O. Montenbruck and E. Gill, Satellite Orbits, 2012, Eq. 2.56–2.68.

state_koe_to_eci(x_oe, use_degrees=False)

Convert Keplerian orbital elements to an ECI Cartesian state vector.

Solves Kepler's equation to obtain the eccentric anomaly, then constructs position and velocity via the perifocal P and Q vectors (Montenbruck & Gill Eq. 2.43–2.44).

Parameters:

Name Type Description Default
x_oe ArrayLike

Orbital elements [a, e, i, RAAN, omega, M]. Semi-major axis in m, angles in rad (or deg if use_degrees=True).

required
use_degrees bool

If True, interpret angular elements as degrees.

False

Returns:

Type Description
Array

ECI state [x, y, z, vx, vy, vz] in m and m/s.

Examples:

import jax.numpy as jnp
from astrojax.constants import R_EARTH
from astrojax.coordinates import state_koe_to_eci
oe = jnp.array([R_EARTH + 500e3, 0.0, 0.0, 0.0, 0.0, 0.0])
state = state_koe_to_eci(oe)
state.shape
References

O. Montenbruck and E. Gill, Satellite Orbits, 2012, Eq. 2.43–2.44.