Dear Wikiwand AI, let's keep it short, summarize this topic like I'm... Ten years old or a College student
A rack railway (also rack-and-pinion railway, cog railway, or cogwheel railway) is a steep grade 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 grades above 10%, which is the maximum for friction-based rail. 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, United Kingdom, where the first commercially successful 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 U.S. state of New Hampshire, which carried its first fare-paying passengers in 1868. The track was completed to reach 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.