Explore the Three-Body Problem
The Three-Body Problem: Why Do Three Stars Become So Unpredictable?
If there were only a single star in the universe, everything would be simple.
If there are two stars, they orbit each other under the influence of gravity. Although their orbits can take many forms, mathematical formulas can describe their motion with absolute precision.
What happens, then, if we add just one more star?
The underlying rules do not change: it is still universal gravitation, still Newtonian mechanics, and each star is still acted upon solely by the gravity of the others. Yet going from two bodies to three makes the entire system suddenly explode into complexity.
This is the famous Three-Body Problem.
Three Stars, Doing Only One Thing
In this simulation, we place three stars together—without collisions, engines, or any external forces.
What each star does is fundamentally simple: it feels the gravitational pull of the other two stars and moves according to Newtonian mechanics.
On the surface, nothing seems particularly complicated.
The crux of the matter is that every star alters the motion of the other two, while the other two in turn alter the first.
Thus, a deceptively simple rule continuously feeds back into itself.
Two Stars Are Orderly; Three Stars Are Entirely Different
What makes the two-body problem special is that it yields elegant analytical solutions. In an ideal setup, two stars revolve around their common center of mass, moving in clean geometric curves such as circles or ellipses.
When we reach the three-body problem, however, the situation changes completely.
This does not mean it is 'impossible to calculate'. Quite the contrary—we can readily compute where they will be in the very next second.
The real challenge is that, unlike the two-body problem, we generally cannot write down a simple analytical formula that directly yields their positions at any arbitrary point in time.
As a result, solving the three-body problem typically relies on numerical methods, stepping forward incrementally in time.
This means the trajectories you see unfolding are not pre-plotted mathematical curves, but the result of the computer letting the three stars advance step by step governed strictly by the law of gravitation.
Sometimes, They Trace Out a Beautiful Figure-8
One of the most fascinating aspects of the three-body problem is that it does not always collapse into sheer chaos.
In fact, physicists and mathematicians have discovered several remarkable periodic orbits, the most famous of which is the figure-8 orbit.
Three stars of equal mass can travel along a path shaped like the number 8. Rather than orbiting some central point independently, all three stars trace out the exact same figure-8 path one after the other. After completing a cycle, they return precisely to their initial state, looking almost as though someone pre-drew an 8 and set the stars to glide along it.
Yet no one prescribed this route for them—it is purely a special solution naturally arising from the equations of gravity.
So when you see the three stars gracefully dance along a crisp figure-8, you are not watching a scripted animation, but an authentic, extraordinary physical motion.
What Happens When Given Random Initial Velocities?
This is where things become truly captivating.
Beyond these carefully tuned periodic orbits, we also provide a random initial state mode, where the starting conditions of the three stars differ on every run.
Under these conditions, you cannot predict ahead of time what trajectories will emerge. Sometimes the stars will intertwine for a long stretch; sometimes they will make thrilling close passes; and in many random cases, a classic finale unfolds: one star is flung violently out of the system, while the remaining two settle into an orbit around each other.
This perfectly reflects the energy exchange inherent in three-body dynamics: continuous exchanges of energy and momentum during repeated close encounters can give one star enough velocity to achieve escape speed and break free from the system.
Therefore, that star suddenly escaping in random mode is not a software glitch; it is simply the natural outcome of a prolonged gravitational tug-of-war among the three bodies.
Why Are Close Encounters So Difficult to Compute?
Here is another intriguing question: what happens when two stars pass extremely close to each other?
Newton's law of universal gravitation follows an inverse-square law: the smaller the separation, the stronger the gravitational pull.
When two stars graze each other at high velocity with minimal distance between them, their velocities can change drastically in a tiny fraction of time.
This simulation automatically reduces its integration time step based on the distance between the closest pair of stars. In other words, the closer the stars get, the more finely the calculations are sliced. This ensures stable, reliable computations even during dramatic close brushes. The nail-biting close encounters you observe are not mere visual flair, but the result of rigorous numerical handling.
The Butterfly Effect: How Can Tiny Differences Change a Trajectory?
Enable “Twin run (butterfly effect)” to see two three-body systems with almost identical initial conditions. They follow the same gravitational laws and differ only by a tiny change in their starting state.
At first, their trajectories nearly overlap. Over time, that small difference can grow, the paths can diverge, and the systems may end up moving very differently.
This sensitivity to initial conditions is a hallmark of chaotic systems, often illustrated by the butterfly effect. The motion still follows definite rules, but tiny uncertainties in the starting state can make long-term prediction difficult.
Why Fix the Center of Mass at the Origin?
To keep the action clearly in view, we lock the system's center of mass at the origin and initialize the total linear momentum to zero.
This prevents the entire system from drifting steadily in one direction and sliding off the screen.
What we genuinely care about is the relative motion among the three stars. By anchoring the center of mass, the display allows you to focus on a single captivating question: where will gravity ultimately steer these three worlds?
Search for Your Own 'Three-Body Fate'
The greatest joy of this simulation lies not just in watching preset orbits.
You can begin by observing the classic periodic orbits, seeing how the three stars pursue each other and seamlessly return to their starting points.
Then switch to random initial conditions. Each launch presents a unique journey. Try running it several times to see whether the stars stay entangled in a prolonged dance, perform close flybys, or eventually eject an outcast body—or perhaps temporarily form an astonishingly orderly pattern.
Sometimes, the emerging paths might even give you the illusion: 'Are they about to settle into a stable orbit?' only for the next close encounter to completely upend the entire system.
Simple Rules Can Generate an Incredibly Complex World
Perhaps the most profound insight the three-body problem offers is not merely 'what gorgeous geometric shapes three stars can trace', but a deeper truth: complexity does not necessarily arise from complex rules.
There are no dozens of intricate regulations, no engineered trajectories, and no complicated control programs here—only three stars and their fundamental gravitational interaction.
Yet when three interdependent motions superimpose, the system exhibits immensely rich behavior: periodic orbits, unpredictable chaotic wanderings, dramatic close brushes, and even the final ejection of an escaping star.
This is the true wonder of the three-body problem: the universe does not need a labyrinth of rules to create complexity; sometimes, just three interacting celestial bodies are more than enough.
Continue Exploring the Physical World
If you would like to move from complex, multi-body interactions toward a more intuitive understanding of how celestial bodies move, you can explore planetary orbits. Here, you can adjust the number of planets, the spacing of their orbits, their eccentricity, and their orbital speeds—observing how the gravitational pull of a central star shapes the motion of the planets, and how various conditions affect the stability of those orbits.
Three celestial bodies governed by the same simple gravitational law can give rise to remarkably intricate motions. Many of the universe's greatest wonders likely began from similarly straightforward rules.
If you are captivated by celestial mechanics, intricate trajectories, and unpredictable dynamical shifts, explore other exhibits in this collection.
Double Pendulum demonstrates chaotic dynamics using two coupled pendulums, while Magnetic Pendulum Fractals reveals intricate basin boundaries formed by competing destinations. What makes the Three-Body Problem truly exceptional is allowing three bodies to reciprocally influence one another, evolving unpredictable journeys from the simplest laws of gravity.
You can also continue discovering more fascinating physical phenomena.