Imagine hitting a baseball with a baseball bat. As the bat moves forward and hits it, the ball recoils going away faster than it was before: it gained kinetic energy from the bat. Contrariwise, if you bunt, so the bat is moving *away* from the ball, the ball slows down and loses kinetic energy.
Now think about a molecule striking the walls of a container. If the walls are moving inward, compressing the gas, the molecules will bounce off going faster than before, gaining kinetic energy — and thus temperature. And vice versa if the walls are moving outward.
Latest Answers