"All the planets in our solar system would fit between Earth and the Moon." This geometric curiosity, recently popularized on CBS Survivor, is mathematically accurate but dynamically catastrophic.
The sum of planetary diameters equals approximately 380,016 km, which indeed fits within the average Earth-Moon distance of 384,400 km. However, this "fit" requires perfect linear alignment and assumes static bodies.
This simulator implements the full N-body problem with 11 gravitating masses: the Sun (as central reference), eight planets, the Moon, and Pluto. The gravitational force on body $i$ is:
$$ \vec{F}_i = \sum_{j \neq i} G \frac{m_i m_j}{|\vec{r}_{ij}|^3} \vec{r}_{ij} $$where $G = 6.674 \times 10^{-11} \text{ m}^3\text{kg}^{-1}\text{s}^{-2}$ is the gravitational constant.
Position Modes:
Velocity Modes:
For circular orbit velocity at radius $r$:
$$ v_{\text{circ}} = \sqrt{\frac{GM_{\odot}}{r}} $$