Degrees of freedom (physics and chemistry)
In physics and chemistry, a degree of freedom is an independent physical parameter in the formal description of the state of a physical system. The set of all states of a system is known as the system's phase space, and the degrees of freedom of the system are the dimensions of the phase space. The location of a particle in three-dimensional space requires three position coordinates. Similarly, the direction and speed at which a particle moves can be described in terms of three velocity components, each in reference to the three dimensions of space. So, if the time evolution of the system is deterministic (where the state at one instant uniquely determines its past and future position and velocity as a function of time), such a system has six degrees of freedom. If the motion of the particle is constrained to a lower number of dimensions – for example, the particle must move along a wire or on a fixed surface – then the system has fewer than six degrees of freedom. On the other hand, a system with an extended object that can rotate or vibrate can have more than six degrees of freedom. In classical mechanics, the state of a point particle at any given time is often described with position and velocity coordinates in the Lagrangian formalism, or with position and momentum coordinates in the Hamiltonian formalism. In statistical mechanics, a degree of freedom is a single scalar number describing the microstate of a system. The specification of all microstates of a system is a point in the system's phase space. In the 3D ideal chain model in chemistry, two angles are necessary to describe the orientation of each monomer. It is often useful to specify quadratic degrees of freedom. These are degrees of freedom that contribute in a quadratic function to the energy of the system. Depending on what one is counting, there are several different ways that degrees of freedom can be defined,
each with a different value. Thermodynamic degrees of freedom for gases

By the equipartition theorem, internal energy per mole of gas equals , where  is absolute temperature and the specific heat at constant volume is cv = (f)(R/2). R = 8.314 J/(K mol) is the universal gas constant, and "f" is the number of thermodynamic (quadratic) degrees of freedom,
counting the number of ways in which energy can occur. Any atom or molecule has three degrees of freedom associated with translational motion (kinetic energy) of the center of mass with respect to the x, y, and z axes. These are the only degrees of freedom for a monoatomic species, such as noble gas atoms. For a structure consisting of two or more atoms, the whole structure also has rotational kinetic energy, where the whole structure turns about an axis. A linear molecule, where all atoms lie along a single axis,
such as any diatomic molecule and some other molecules like carbon dioxide (CO2),
has two rotational degrees of freedom, because it can rotate about either of two axes perpendicular to the molecular axis. A nonlinear molecule, where the atoms do not lie along a single axis, like water (H2O), has three rotational degrees of freedom, because it can rotate around any of three perpendicular axes. In special cases, such as adsorbed large molecules, the rotational degrees of freedom can be limited to only one. A structure consisting of two or more atoms also has vibrational energy, where the individual atoms move with respect to one another. A diatomic molecule has one molecular vibration mode: the two atoms oscillate back and forth with the chemical bond between them acting as a spring. A molecule with  atoms has more complicated modes of molecular vibration, with  vibrational modes for a linear molecule and  modes for a nonlinear molecule. As specific examples, the linear CO2 molecule has 4 modes of oscillation, and the nonlinear water molecule has 3 modes of oscillation
Each vibrational mode has two energy terms: the kinetic energy of the moving atoms and the potential energy of the spring-like chemical bond(s). Therefore, the number of vibrational energy terms is  modes for a linear molecule and is  modes for a nonlinear molecule. Both the rotational and vibrational modes are quantized, requiring a minimum temperature to be activated. The "rotational temperature" to activate the rotational degrees of freedom is less than 100 K for many gases. For N2 and O2, it is less than 3 K.
The "vibrational temperature" necessary for substantial vibration is between 103 K and 104 K, 3521 K for N2 and 2156 K for O2. Typical atmospheric temperatures are not high enough to activate vibration in N2 and O2, which comprise most of the atmosphere. (See the next figure.) However, the much less abundant greenhouse gases keep the troposphere warm by absorbing infrared from the Earth's surface, which excites their vibrational modes. Much of this energy is reradiated back to the surface in the infrared through the "greenhouse effect." Because room temperature (≈298 K) is over the typical rotational temperature but lower than the typical vibrational temperature, only the translational and rotational degrees of freedom contribute, in equal amounts, to the heat capacity ratio. This is why ≈ for monatomic gases and ≈ for diatomic gases at room temperature. Since the air is dominated by diatomic gases (with nitrogen and oxygen contributing about 99%), its molar internal energy is close to  = (5/2), determined by the 5 degrees of freedom exhibited by diatomic gases. See the graph at right. For 140 K <  < 380 K, cv differs from (5/2) d by less than 1%. Only at temperatures well above temperatures in the troposphere and stratosphere do some molecules have enough energy to activate the vibrational modes of N2 and O2. The specific heat at constant volume, cv, increases slowly toward (7/2)  as temperature increases above T = 400 K, where cv is 1.3% above (5/2) d = 717.5 J/(K kg). Counting the minimum number of co-ordinates to specify a position

One can also count degrees of freedom using the minimum number of coordinates required to specify a position. This is done as follows:
 For a single particle we need 2 coordinates in a 2-D plane to specify its position and 3 coordinates in 3-D space. Thus its degree of freedom in a 3-D space is 3. For a body consisting of 2 particles (ex. a diatomic molecule) in a 3-D space with constant distance between them (let's say d) we can show (below) its degrees of freedom to be 5. Let's say one particle in this body has coordinate  and the other has coordinate  with  unknown. Application of the formula for distance between two coordinates

results in one equation with one unknown, in which we can solve for . One of , , , , , or  can be unknown. Contrary to the classical equipartition theorem, at room temperature, the vibrational motion of molecules typically makes negligible contributions to the heat capacity. This is because these degrees of freedom are frozen because the spacing between the energy eigenvalues exceeds the energy corresponding to ambient temperatures (). Independent degrees of freedom
The set of degrees of freedom  of a system is independent if the energy associated with the set can be written in the following form:

where  is a function of the sole variable . example: if  and  are two degrees of freedom, and  is the associated energy:
 If , then the two degrees of freedom are independent. If , then the two degrees of freedom are not independent. The term involving the product of  and  is a coupling term that describes an interaction between the two degrees of freedom. For  from 1 to , the value of the th degree of freedom  is distributed according to the Boltzmann distribution. Its probability density function is the following:
 ,

In this section, and throughout the article the brackets  denote the mean of the quantity they enclose. The internal energy of the system is the sum of the average energies associated with each of the degrees of freedom:

Quadratic degrees of freedom
A degree of freedom  is quadratic if the energy terms associated with this degree of freedom can be written as
,

where  is a linear combination of other quadratic degrees of freedom. example: if  and  are two degrees of freedom, and  is the associated energy:
 If , then the two degrees of freedom are not independent and non-quadratic. If , then the two degrees of freedom are independent and non-quadratic. If , then the two degrees of freedom are not independent but are quadratic. If , then the two degrees of freedom are independent and quadratic. For example, in Newtonian mechanics, the dynamics of a system of quadratic degrees of freedom are controlled by a set of homogeneous linear differential equations with constant coefficients. Quadratic and independent degree of freedom
 are quadratic and independent degrees of freedom if the energy associated with a microstate of the system they represent can be written as:

Equipartition theorem

In the classical limit of statistical mechanics, at thermodynamic equilibrium, the internal energy of a system of  quadratic and independent degrees of freedom is:
 

Here, the mean energy associated with a degree of freedom is:

Since the degrees of freedom are independent, the internal energy of the system is equal to the sum of the mean energy associated with each degree of freedom, which demonstrates the result. Generalizations
The description of a system's state as a point in its phase space, although mathematically convenient, is thought to be fundamentally inaccurate. In quantum mechanics, the motion degrees of freedom are superseded with the concept of wave function, and operators which correspond to other degrees of freedom have discrete spectra. For example, intrinsic angular momentum operator (which corresponds to the rotational freedom) for an electron or photon has only two eigenvalues. This discreteness becomes apparent when action has an order of magnitude of the Planck constant, and individual degrees of freedom can be distinguished. References

Physical quantities
Dimension