larzorbits
Real two-body orbital mechanics and rocket-propulsion math.
Kepler's third law, the vis-viva equation, escape and circular velocity, Hohmann transfers, the Tsiolkovsky rocket equation and its inverse, and impact kinetic energy. Every formula is checked against a well-known real reference figure - the ISS's real orbital period, Earth's real escape velocity, the textbook LEO-to-GEO Hohmann transfer, the Chelyabinsk meteor's real estimated impact yield - not just transcribed from a textbook and trusted.
What you get
- Kepler's third law + the vis-viva equation
- Escape and circular velocity
- Hohmann transfer delta-v and coast time
- Tsiolkovsky rocket equation, and its inverse
- Impact kinetic energy in kilotons of TNT
Try it
import "orbits" as orbits
print("ISS orbital period:", round(orbits.orbital_period(6779) / 60, 1), "min")
print("Earth escape velocity:", round(orbits.escape_velocity(orbits.EARTH_RADIUS_KM), 2), "km/s")
let h = orbits.hohmann_transfer(6771, 42164)
print("LEO->GEO delta-v:", round(h["dv_total_km_s"], 3), "km/s over", round(h["transfer_time_s"] / 3600, 1), "hours")
let dv = orbits.rocket_delta_v(orbits.isp_to_exhaust_velocity(320), 50000, 12000)
print("rocket delta-v (Isp 320s, 50t->12t):", round(dv / 1000, 2), "km/s")
let joules = orbits.kinetic_energy_j(12000000.0, 19000)
print("a 20m/19km/s impactor releases:", round(orbits.joules_to_kilotons_tnt(joules), 0), "kt TNT-equivalent")ISS orbital period: 92.6 min Earth escape velocity: 11.19 km/s LEO->GEO delta-v: 3.857 km/s over 5.3 hours rocket delta-v (Isp 320s, 50t->12t): 4.48 km/s a 20m/19km/s impactor releases: 518 kt TNT-equivalent
Why it's in the Larz Stack
larzorbits is a real Larzscript package (larzscript pkg install orbits) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.