Note that in going from the initial to the final arrangements in Fig. 6.1, ball B gains potential energy because work was done by ball A on B. Work is defined as force acting over a distance. Work is required to raise B from its original position to its final one. Part of the original energy stored as potential energy in A has been transferred through work to B, thereby increasing B’s potential energy. Thus there are two ways to transfer energy: through work and through heat.