Find the simulation here: http://www.mathandcode.com/gravity/
The two-body problem consists of two objects under gravitational attraction. The attraction force is the newtonian force \(G \frac{M_1 M_2}{d^2}\), where G is some constant, M is mass and distance is the distance between the two objects.
In the two-body problem, the path of each particle can be solved for explicitly. We can get circles or ellipses, like the earth’s path around the sun, or we can get escape trajectories where the two particles pass by and never collide with each other again, taking the form of hyperbolas and parabolas.
The three-body problem is more difficult though. Three-bodies can cause chaos, and you can’t solve it explicitly for hyperbolas/parabolas. The only way to solve the general case is to simulate the system over time.
It’s hard to get to grips with the chaos of the three body problem, but this program tries to depict it.
It starts out with three bodies with the same mass/radius and sends them off in different velocities. From this, you can calculate the future path of the particles. This program shows the path of three objects over the full simulation, so instead of viewing three circles (the particles current positions), you see three lines (the particles paths given the starting conditions). As the initial velocity varies over time, the paths vary, and you get chaotic looking results.


