A rack-and-pinion railway (also rack railway, cog railway) is a railway with a toothed rack rail, usually between the running rails.
A rack-and-pinion railway (also rack railway, cog railway) is a railway with a toothed rack rail, usually between the running rails. The trains are fitted with one or more cog wheels or pinions that mesh with this rack rail. This allows the trains to operate on steep gradients.Most rack railways are mountain railways, although a few are transit railways or tramways built to overcome a steep gradient in an urban environment.The first cog railway was the Middleton Railway between Middleton and Leeds in West Yorkshire, England, UK, where the first commercial steam locomotive, Salamanca, ran in 1812. This used a rack and pinion system designed and patented in 1811 by John Blenkinsop. The first mountain cog railway was the Mount Washington Cog Railway in the US state of New Hampshire, which carried its first fare-paying passengers in 1868 and reached the summit of Mount Washington in 1869. The first mountain rack railway in continental Europe was the Vitznau-Rigi-Bahn on Mount Rigi in Switzerland, which opened in 1871. Both lines are still running.