Motivated by the formal argument that a non-zero shear modulus is the result of averaging over a constrained configurations space, we demonstrate that the shear modulus calculated over a range of temperatures and averaging times can be expressed (relative to its infinite frequency value) as a single function of the mean squared displacement. This result is shown to hold for both a glass-liquid and a crystal-liquid system.