Gasses are matter whose atoms are constantly bouncing around like they’re on crack. If a gas is hotter the atoms have more energy, bounce around faster, which causes the gas itself to expand (become less dense).
If energy is removed, the gas cools, the atoms bounce slower, and the density increases.
Latest Answers