The steam locomotive uses boiling water to make a steam. This energy transformation undergoes from a heat energy. The steam was then used to "pipe" inside the cylinder which is responsible for the motion of pistons moving within each other. They alternating movement of the piston is now used to drive the steam engine.