# what's the difference between linear n-atom molecule and nonlinear n-atom molecule?

I am reading a material about the degree of freedom for linear n-atom molecule and nonlinear n-atom molecule. Here is my analysis for a diatomic molecule, if there are two atoms, we have to use 3 coordinates to describe the translational motion, 2 coordinates about the rotation and 1 for vibration, so total will be 6 degree of freedom for diatomic molecule. According to the equipartition theorem of the energy, when there are N molecule, each degree of freedom share $kT/2$ energy, so total $$E = 6\times \frac{NkT}{2}$$ and the heat capacitor is $$C = \frac{dE}{dT} = 3Nk$$

But in other book, it said that the heat capacitor for diatomic molecule is $\frac{7Nk}{2}$. I am googleing the issue and someone said the vibration energy consists of kinetic energy and potential energy so there are actually 7 degree of freedom instead of 6. Is this statement correct?

It is pretty confusing because in the wiki http://en.wikipedia.org/wiki/Degrees_of_freedom_%28physics_and_chemistry%29, it states that the linear N-atom molecule has 3 positions, 2 rotations and 3N-5 vibrations so total 3N degree of freedom, if N=2, then we will have 6 degree of freedom instead of 7. So which conclusion is correct?

BTW, what's the main difference between the linear and nonlinear n-atom molecule?