Barycentre calculator for DegreesOfFreedom.

Also, a test class for DegreesOfFreedom.