If you have N particles on a surface of a rigid body and the rigid body is rotating about some axis, we say there are six generalised coordinates for the system (N particles on the surface) and set up the lagrangian.
The constraints we know are
The distance between any two particles is invariant
The angles between the line joining any particles is invariant as well and that's it.
We also know a formula for finding the number of genralised coordinates i.e difference between number of degrees of freedom (3N) and number of constraints (which is N(N-1)/2). Clearly using this formula doesn't give 6 generalised coordinates.
Where's the mistake and how to count the number of generalised coordinates?
Note : Even I know the argument as to if you know 3 points on surface, you can determine the position of any other particle on the surface. But my question is about counting the generalised coordinates using the above formula.