In statistical mechanics, the radial distribution function, (or pair correlation function) g ( r ) in a system of particles (atoms, molecules, colloids, etc.), describes how density varies as a function of distance from a reference particle.