Route geometry and pace physics for JavaScript and Swift, open source and held to the same numbers by 242 shared test vectors. Move the sliders: every figure below is computed live by the library.
npm install trailphysics
SwiftPM.package(url: "https://github.com/ehilzinger/trailphysics-swift", from: "0.1.3")
Dashed: a loaded tourer, 75 + 25 kg at 180 W, for comparison.
Loading trailphysics…
Below −2% the model has the rider freewheel, which is the step in the curve. Descents are capped at 65 km/h.
Loading trailphysics…
Dashed: hiking the same ground by the signpost rule, for comparison.
Loading trailphysics…
Downhill, running never gets faster than 85% of the flat pace. Past 25% the climb is run or power-hiked, whichever is quicker.
Loading…
The JavaScript package writes the test vectors; the Swift package reads byte-identical copies, and both suites check every one. A phone and a browser give the same person the same time for the same route. How the vectors work.