# Degrees of freedom (Rigid bodies)

A rigid body has 6 degrees of freedom, which can be derived from counting the coordinates of different points on it and the independent constraints on those coordinates which arise from the fact that the body is rigid. For e.g. take an arbitrary point \(A\) on a rigid body, which can be represented by Cartesian coordinates \((x_A,y_A,z_A)\) with respect to some origin \(O\). Now take another point \(B\) on the same rigid body. The Cartesian coordinates of point \(B\) however cannot be arbitrary, since it has a fixed distance \(d(A,B)\) from \(A\). Thus \((x_B, y_B, z_B)\) must lie somewhere on the sphere centered at \(A\) with radius \(d(A,B)\). Since we need only 2 numbers to specify a point on a sphere (e.g. latitude and longitude). Similarly fixing a point \(C\) gives us another sphere centered at \(B\) with radius \(dist(B,C)\), but now the coordinates \((x_C,y_C,z_C)\) of \(C\) must lie in the intersection of both of these spheres, which is a circle, thus can be specified with just 1 number.

In general, DOF of any C-space (even non-rigid) is given by: \[\sum \text{freedom of bodies - \# of independent constraints}\]

Grubler's formula for rigid bodies **with independent constraints**:
\[DOF = m(N-1-J) +\sum_{i=1}^J f_i\]
Where \(N\) is the number of bodies **including ground** (which is why we subtract 1), \(J\) is the number of joints, \(m\) is 6 for spatial bodies and 3 for planar bodies. Testing whether the constraints are independent is a non-trivial task.