The 3 Body Problem

The three-body problem is famous for being an unsolved problem in physics and classical mechanics. It has no "closed form" solution, or in other words, there is no equation that can predict where any one of the three bodys will be, unlike a two body problem, like the Earth and Sun. Instead, the result is eventual chaos, and in the case of this simulation, the planets fly off the edge of the screen pretty quickly. Notice how changing the numbers even slightly greatly impacts the planets tragectories. This is primarily why the problem is so difficult, it's very hard to make accurate predictions.

The default values were the values that for my testing, made the planets stay on the screen for as long as possible, see if you can beat it!

2 Planet best values: 5000, 0, 300000, 0, -5000, 0

3 Planet best values: 5000, -4000, 2498, 5500, -4500, 2000

Three-body problem illustration

* The Earth and Sun are not actually a two body problem, however the force of attraction from other celestial bodies is relatively low, resulting in a fairly stable and predictable orbit.