In fluid mechanics, hydrostatic equilibrium (hydrostatic balance, hydrostasy) is the condition of a fluid or plastic solid at rest, which occurs when external forces, such as gravity, are balanced by a pressure-gradient force. In the planetary physics of Earth, the pressure-gradient force prevents gravity from collapsing the planetary atmosphere into a thin, dense shell, whereas gravity prevents the pressure-gradient force from diffusing the atmosphere into outer space. In general, it is what causes objects in space to be spherical.