---
title: "Roadmap"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Roadmap}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

`orbitr` is a work in progress. This page is a running list of features I'm thinking about adding in future versions. Nothing here is promised, and the priority order is loose — it mostly reflects what I personally find interesting or what users have asked for. If any of these sound useful (or terrible), let me know. Suggestions, feedback, and pull requests are all very welcome.

## Physics

### A `radius` argument on `add_body()`

Right now bodies are treated as point masses. This is fine for most orbital distances — gravity outside a sphere behaves exactly as if all the mass were concentrated at its center (the shell theorem) — but it means there's no concept of two bodies physically touching. Adding an optional `radius` parameter would enable collision detection, merging on contact, and more realistic close-encounter behavior.

I'd probably add it to `add_body()` as an optional parameter with a sensible default, something like:

```r
add_body <- function(system, id, mass, x = 0, y = 0, z = 0,
                     vx = 0, vy = 0, vz = 0, r = NULL)
```

If `r` is supplied for any body in the system, the integrator would check for overlaps on each step and handle them according to a user-chosen policy (elastic bounce, inelastic merge, simulation halt, etc.).

In the meantime, the existing `softening` parameter on `simulate_system()` partly works around the missing-radius problem by preventing the gravitational force from blowing up at very small separations — see [The Physics](the-physics.html) for details.

### Non-gravitational forces

Optional support for forces beyond pure Newtonian gravity:

- **Atmospheric drag** for low orbits around bodies with atmospheres
- **Radiation pressure** for small bodies near a star
- **J2 oblateness corrections** for orbits around non-spherical bodies (Earth's equatorial bulge measurably perturbs satellite orbits)

### General-relativistic corrections

A small post-Newtonian correction term would let `orbitr` reproduce real GR effects like the precession of Mercury's perihelion. Probably opt-in via an argument on `simulate_system()`, since most users wouldn't need it.

## Setup helpers

### ~~Construct bodies from Keplerian orbital elements~~ ✅ Added in v0.2.0

Implemented as `add_body_keplerian()`. See `?add_body_keplerian` for details.

### ~~A `load_solar_system()` convenience~~ ✅ Added in v0.2.0

Implemented as `load_solar_system()`. Builds the Sun, all eight planets, the Moon, and Pluto using real Keplerian elements from JPL DE440. See `?load_solar_system` for details.

## Quality of life

### Save and load simulation state

Functions to serialize an `orbit_system` (or a completed simulation tibble) to disk and reload it later. Useful for long-running simulations and for sharing reproducible setups.

### Progress bar for long simulations

A simple progress indicator on `simulate_system()` for runs that take more than a few seconds, with an option to disable it for scripted use.

### Built-in conservation diagnostics

Helpers to compute total energy, total linear momentum, and total angular momentum at every time step, so you can sanity-check an integrator's behavior over the course of a run. Useful for confirming Velocity Verlet is doing its job, and for spotting cases where the time step is too large.

## Suggestions Welcome

If any of these sound useful, if you'd like to see something not on this list, or if you have a use case that `orbitr` doesn't currently handle well, please open an issue on [GitHub](https://github.com/DRosenman/orbitr/issues). I'd love to hear about how people are using the package and what would make it more useful. Pull requests are also very welcome.
