TINYBOT FORGE
Home › Learn › Brachistochrone ball race

Brachistochrone ball race: why the shortest track loses

Play in your browserOur simulationFree Python codeUpdated October 26, 2026

Five balls start together 0.9 m above the finish and 1.5 m to its left. The straight track is the shortest (1.75 m), yet it comes last, 54 cm behind when the winner crosses the line. The winner is the brachistochrone, a cycloid, 1.89 m long: 0.820 s against 0.985 s. Bend your own track below and see how close you can get.

Can you beat the cycloid?

Drag the four amber handles to shape your white track, then press Race.

t = 0.00 s
TrackTimeBehindLength

Solid balls rolling without slipping, no friction losses or air drag. "Behind" is how much track a ball still has left when the cycloid ball arrives. Times update live while you drag.

The race, measured

All five tracks join the same two points. We timed each with the same physics model (below) for a solid ball that rolls without slipping and, for comparison, a frictionless sliding bead, the version in the original 1696 puzzle.

Track (start 0.9 m up, 1.5 m across)LengthRolling ballSliding beadBehind at the finish
Cycloid (brachistochrone)1.89 m0.820 s0.693 swinner
Circle arc (Galileo's guess)1.84 m0.834 s0.705 s4.9 cm
Dip below the finish2.09 m0.848 s0.717 s10.0 cm
Straight drop + turn2.21 m0.877 s0.742 s20 cm
Straight line (shortest)1.75 m0.985 s0.833 s54 cm
Left: the five tracks from A to B. Right: horizontal distance against time; the cycloid reaches 1.5 m first at 0.820 s, the straight line last at 0.985 s
Left: the tracks. Right: how far across each ball has got over time; the dot is its finish. Drawn by race.py from the free download.
Two frames of our Short: a white robot releases four steel balls onto red (straight), orange (curve), blue (drop) and green (dip) rails on a wooden board
The same race in our YouTube Short, rendered in Blender from this model (an original robot design; physics simulation, not AI-generated video). The curve in the Short is the cycloid.

Why the longer track wins

Experiment: an optimizer rediscovers the cycloid

Instead of trusting the textbook, we asked a computer. The track is a chain of straight pieces at equal steps across; the height of every joint is free. Starting from the straight line, scipy's L-BFGS-B optimizer changes the heights to make the ball's time as short as possible. It is told nothing about cycloids.

Optimized tracks with 4 to 64 straight pieces converge onto the amber cycloid; 64 pieces: 0.8215 s vs the cycloid 0.8204 s
Each blue line is the best track the optimizer found with that many pieces. Drawn by optimize.py.
PiecesBest timeSlower than the cycloidLargest gap to the cycloid…after the first cornerRace-time evaluations
40.8417 s+2.59%76 mm43 mm56
80.8301 s+1.18%47 mm32 mm176
160.8250 s+0.56%29 mm21 mm816
320.8226 s+0.27%18 mm14 mm5,216
640.8215 s+0.13%11 mm9 mm14,976

With more pieces the optimizer's best track gets faster and closer to the cycloid: 64 pieces come within 0.13% of the exact cycloid time (0.8204 s). The largest gap is always at the first joint next to the start, where the true cycloid is vertical and a straight piece can only approximate it. This is the same idea robots use to plan fast motions (trajectory optimization): describe the motion with numbers, simulate it, let an optimizer improve it.

Bonus: the cycloid's other trick

Release balls from different heights on the same cycloid and they all reach the bottom at the same moment. Christiaan Huygens described this "tautochrone" property in 1673 and used it in pendulum clocks [4]. Our model agrees to four decimals, for every start height, and matches the formula π √(r / (5/7 g)) = 0.7970 s:

Start height above the bottomTime to the bottom
90.2 cm0.7970 s
67.6 cm0.7970 s
45.1 cm0.7970 s
22.5 cm0.7970 s
4.5 cm0.7970 s

How the simulation works

Each track is a chain of short straight pieces (2,000 for the curves above). On a straight piece the slope is constant, so the acceleration is constant too, and the time to cross it is exact: t = 2 · length / (speed at the start + speed at the end). The speed at any height comes from energy: v = √(2 · k · g · drop), with k = 5/7 for a solid ball rolling without slipping (rolling-motion equation a = g sin θ / (1 + I/mr²) with I = 2/5 m r² [3]) and k = 1 for a sliding bead. Two checks against closed-form answers:

The browser game uses a JavaScript port of the same code. For the five tracks above the two versions agree to 2e-15 s.

Get the Python code (free)

Race any start and finish you like (--height, --width), switch to a sliding bead (--slide), make the slow-motion gif, run the optimizer with your own number of pieces, and check the tautochrone. About 350 lines of Python: numpy + scipy + matplotlib.

Download the brachistochrone code

Enter your email and we'll send you a confirmation email: click it and your download starts. We'll also email you when we publish a new robot experiment (about once a week). Unsubscribe anytime.

Free. Personal and educational use, including classes.

We ran it from a fresh virtual environment (Python 3.13.17, numpy 2.5.4, scipy 1.18.1, matplotlib 3.11.2, pillow 13.0.0). This is the real output; the whole run took a few seconds:

$ python -m venv venv && source venv/bin/activate
$ pip install -r requirements.txt
$ python race.py --gif
Start 0.90 m above the finish, 1.50 m across. Solid ball rolling without slipping (k = 0.7143).
Track                            length     time  behind at finish
Cycloid (brachistochrone)       1.887 m  0.820 s            0.0 cm
Circle arc (Galileo's guess)    1.837 m  0.834 s            4.9 cm
Dip below the finish            2.089 m  0.848 s           10.0 cm
Straight drop + turn            2.207 m  0.877 s           20.2 cm
Straight line (shortest)        1.749 m  0.985 s           53.6 cm
Cycloid check: closed form 0.8204 s, polyline 0.8204 s (r = 0.451 m, theta = 3.234 rad)
wrote race.png
wrote race.gif
$ python optimize.py
Cycloid (exact): 0.8204 s.  Straight line: 0.9851 s.
pieces  best time  vs cycloid  max gap to cycloid  evaluations  seconds
     4   0.8417 s     +2.59 %            76.2 mm           56      0.0
     8   0.8301 s     +1.18 %            46.6 mm          176      0.0
    16   0.8250 s     +0.56 %            28.6 mm          816      0.1
    32   0.8226 s     +0.27 %            17.6 mm         5216      0.4
    64   0.8215 s     +0.13 %            11.0 mm        14976      1.4
wrote optimize.png
$ python tautochrone.py
Cycloid r = 0.451 m. Theory for every start: 0.7970 s
 start height above bottom  time to bottom
                  90.2 cm        0.7970 s
                  67.6 cm        0.7970 s
                  45.1 cm        0.7970 s
                  22.5 cm        0.7970 s
                   4.5 cm        0.7970 s

And with --slide (a frictionless bead). Every time is shorter by the same factor √(7/5) = 1.183, so the order and the gaps don't change:

$ python race.py --slide
Start 0.90 m above the finish, 1.50 m across. Sliding bead, no friction (k = 1.0000).
Track                            length     time  behind at finish
Cycloid (brachistochrone)       1.887 m  0.693 s            0.0 cm
Circle arc (Galileo's guess)    1.837 m  0.705 s            4.9 cm
Dip below the finish            2.089 m  0.717 s           10.0 cm
Straight drop + turn            2.207 m  0.742 s           20.2 cm
Straight line (shortest)        1.749 m  0.833 s           53.6 cm
Cycloid check: closed form 0.6934 s, polyline 0.6934 s (r = 0.451 m, theta = 3.234 rad)
wrote race.png

Limits of this simulation

Build a robot, not just a race track

Kit 1 is our ESP32 obstacle-avoiding car kit, with a simulation twin of the same car. Its avoidance code was tested in 40 simulated rooms before we built it: see that experiment.

One email when Kit 1 opens. Unsubscribe anytime.

More experiments you can run: race 4 robot vacuums in your own room and CMA-ES vs reinforcement learning on a walking robot.

FAQ

What is the brachistochrone?

The curve of fastest descent: the track between two points, one lower than the other, on which a ball (or a bead) rolling under gravity alone gets there in the least time. Johann Bernoulli posed it as a challenge in Acta Eruditorum in June 1696; the answer is a cycloid, the curve traced by a point on a rolling wheel.

Why is the straight line not the fastest path?

Speed comes from height. A track that drops steeply at the start makes the ball fast early and keeps it fast for the rest of the way, which more than pays for the longer distance. In our race the straight line was the shortest track (1.75 m) and the slowest (0.985 s); the cycloid was 0.14 m longer and won in 0.820 s.

Was Galileo right that a circle is fastest?

Close, but no. In 1638 Galileo argued that an arc of a circle beats the straight line, which is true, and suggested it was the fastest path, which is not. On our track his circle arc finished 4.9 cm behind the cycloid (0.834 s vs 0.820 s).

Does it matter if the ball rolls or slides?

Not for who wins. A solid ball rolling without slipping speeds up at 5/7 of a frictionless slider's rate, so every time gets longer by the same factor (1.183) and the order and the gaps at the finish stay the same. The cycloid wins either way: 0.693 s sliding, 0.820 s rolling.

Can a computer find the fastest track on its own?

Yes. We gave an optimizer a track made of straight pieces, started it from the straight line and let it minimize the race time. With 64 pieces it found a track only 0.13% slower than the exact cycloid, lying on the cycloid to within 9 mm everywhere except the first corner. The code is in the free download.

Sources

  1. J. J. O'Connor and E. F. Robertson, The brachistochrone problem, MacTutor History of Mathematics, University of St Andrews (Johann Bernoulli's challenge, Acta Eruditorum, June 1696; the solutions of Newton, Jacob Bernoulli, Leibniz and l'Hôpital; Galileo's circle-arc argument of 1638).
  2. Galileo Galilei, Dialogues Concerning Two New Sciences (1638), English translation by H. Crew and A. de Salvio, Macmillan, 1914.
  3. OpenStax, University Physics Volume 1, 11.1 Rolling Motion, equation 11.4 (acceleration of an object rolling without slipping down an incline).
  4. L. R. Evangelista and F. Mainardi, The Tautochrone of Huygens and Abel: From Constructive Geometry to Fractional Calculus, arXiv:2509.05308 (Huygens, Horologium Oscillatorium, 1673).
  5. Simulation, optimizer, measurements and images: TinyBot Forge, October 2026. All numbers on this page come from the code in the free download (analysis script available on request).

Need a physics simulation for your class or product?

We build physics-simulated robot videos and Python simulations to order.

Email us