When an engineer has to construct a railway up a hill having a still steeper slope, he must secure practicable gradients by laying out the line in ascending spirals, if necessary tunnelling into the hill, as on the St Gothard railway, or in a series of zigzags, or he must resort to a rack or a cable railway.