Learn Kepler's laws, orbital velocity, and n-body gravity by building your own solar system simulation in PHYSIX — no maths degree required.
Johannes Kepler derived three empirical laws of planetary motion from Tycho Brahe's observations. Newton later showed they all follow from the inverse-square gravitational force law.
Planets move in elliptical orbits with the Sun at one focus. Eccentricity e = 0 is a circle, e < 1 is an ellipse, e ≥ 1 is escape.
A line joining a planet to the Sun sweeps out equal areas in equal times. This means planets move faster at perihelion and slower at aphelion.
The square of the orbital period is proportional to the cube of the semi-major axis. This lets you predict periods from distances.
Click 🗑 CLEAR then 🌍 Space in the topbar to enter the astronomical viewport.
Drag a ⭐ Star to the centre of the canvas. Set mass = 2×10³⁰ kg (one solar mass), pinned = true.
Drag a 🪐 Planet 150 billion metres (1 AU) to the right of the star. Set mass = 6×10²⁴ kg (Earth mass).
For a circular orbit: v = √(GM/r). With M = 2×10³⁰ and r = 1.5×10¹¹: v ≈ 29,800 m/s. Set Vy = 29800 m/s on the planet.
From the GRV force tab, drag Newton's Gravity (1/r²) onto the planet. Set source = Star, G = 6.674×10⁻¹¹.
Set speed to 10× or 100×. Watch the planet orbit. Enable Trails to see the elliptical path. Is it a circle? If not, adjust Vy slightly.
Once you have one planet orbiting, adding more is straightforward — but the interactions between planets create a rich, complex system that is analytically unsolvable for N ≥ 3. PHYSIX uses a 4th-order Runge-Kutta integrator to keep errors small.
Try turning off the pinned flag on the Sun. With the Sun free to move, you'll see it wobble due to gravitational tugs from Jupiter — this is how astronomers detect exoplanets using the radial velocity method.
Place a planet orbiting your star. Note the orbital speed v_circular at distance r.
Gradually increase the planet's Vy in the properties panel. At v = √2 × v_circular, the orbit changes from ellipse to parabola — the exact escape velocity.
Below escape velocity: closed ellipse. At escape: open parabola. Above escape: hyperbola. The trail makes these conic sections visually obvious.
A gravitational slingshot (gravity assist) uses a planet's gravity well to accelerate a spacecraft without burning fuel. Set up Jupiter in a stable orbit, then send a small body on a hyperbolic flyby trajectory — watch its speed increase after the encounter.
For Lagrange points: with the Sun and Earth in orbit, place a very small test mass (m ≈ 0 kg) at five specific locations and it will remain roughly stationary. The L4 and L5 points (60° ahead and behind Earth) are where the Trojan asteroids cluster.