The first railroad lines were laid along the flattest routes possible, but the requirements of industry—particularly mining—soon demanded that trains could travel uphill. The earliest solution was the “incline”—a pair of parallel tracks that enabled a descending train to haul an ascending train uphill by means of a chain that connected the two via a pulley. This worked particularly well on the short sections of track that were used to draw raw materials up from pits and quarries, and variants were powered by horses or stationary steam engines. The basic premise lies behind modern-day funicular railroads, and other engineering solutions, such as spiral loops and switchbacks, have also been developed.

.
Spiral loop
Building a railroad track on a spiral allows a train to gain elevation in a much shorter length of track than would be possible with a conventional curve. Spiral loops also avoid the inconveniences of reverse travel and interrupted movement that are necessary when climbing switchbacks, the other railroad engineering method by which traction trains climb hills (see above). Popular in challenging terrain, such as mountainous regions in which level ground is limited, spirals are set at a constant grade and degree of curvature, and allow the track to pass over itself as the line ascends.

.
Funicular railroads
The first funicular railroad—a form of cable car operating on similar principles to a railroad incline—opened in 1862 in Lyon, France, and featured a four-rail track layout on which two cars traveled on separate parallel tracks. The development of sidings allowed later designs to economize on the space and materials used. First came a three-rail layout, in which cars shared a central rail—then came a two-rail layout in which the cars shared both rails on either side of the siding.

.
How it works
Two- and three-rail funiculars contain a siding at the halfway point. Each car has “blind” (flangeless) inner wheels and double-flanged outer wheels to prevent them from switching rails.
