Desktop app · Python · Streamlit

What a coach does on a curve

A small Streamlit app that shows what happens when a railway coach goes round a curve. Set the coach length, the distance between its bogies, the curve radius, the gauge, the number of tracks and a safety clearance.

It computes the centre throw (how far the middle of the coach cuts inside the curve) and the end throw (how far its corners swing outside), and draws the coaches from above so you can see whether adjacent tracks keep their clearance.

Source code

What it does

All in metres

Coach length, bogie offset, curve radius, number of tracks, gauge (1.435 m standard) and clearance.

Centre throw

From the versine of the bogie chord.

End throw

The corner overhang beyond the bogies.

Drawn from above

Tracks and coaches with the clearance envelope (matplotlib).

Explore

Random and reset buttons try other configurations quickly.

Run it

uv installs Python 3.12 and the dependencies (Streamlit, matplotlib, NumPy). Run it from the project folder, so Streamlit reads its settings; it opens at http://localhost:8501.

uv sync
uv run streamlit run src/railway_geometry_visualiser/main.py

Privacy

It runs locally: the project's Streamlit settings bind it to localhost (Streamlit's default listens on your whole network and looks up your public IP) and turn off Streamlit's usage statistics. It stores nothing; inputs live in the browser session.

This page stores only your light or dark choice, whether you hid the intro, and your answer to the notice, all on this device.