goll.cc
🇧🇷

Brachistochrone Demo

A brachistochrone curve is a curve that reduces the time needed for a body under the influence of gravity to go from one point to another.

Click here to see a physical simulation of such a curve, that allows for measuring how long a ball with radius and density (mass ) takes to complete its trajectory going from an initial to a final position when following a brachistochrone curve, and comparing it to a straight line path.

In an ideal scenario, considering and , the time taken for a point mass to go from to (the default simulation parameters) is approximately . The time measured by the simulation will invariably be higher, for various reasons, the most notorious being not actually using a point mass.

The simulation was written in Rust, using the Bevy game engine and the Rapier physics engine, implementing an algorithm based on Dynamic Programming to approximate the brachistochrone curve. The source code for the simulation can be found here. You will need a browser with support for JavaScript, WebAssembly and WebGL to run the simulation.