text: In the theory of many-particle systems, Jacobi coordinates often are used to simplify the mathematical formulation.  These coordinates are particularly common in treating polyatomic molecules and chemical reactions, and in celestial mechanics. An algorithm for generating the Jacobi coordinates for N bodies may be based upon binary trees. In words, the algorithm is described as follows:
   and m be the masses of two bodies that are replaced by a new body of virtual mass M = m + m. The position coordinates x and x are replaced by their relative position  r = x &minus; x and by the vector to their center of mass R = (m q + mq)/(m +  m). The node in the binary tree corresponding to the virtual body has m as its right child and m as its left child. The order of children indicates the relative coordinate points from x to x. Repeat the above step for N &minus; 1 bodies, that is, the N &minus; 2 original bodies plus the new virtual body. </blockquote>
  For the N-body problem the result is:
  with
  The vector  is the center of mass of all the bodies and  is the relative coordinate between the particles 1 and 2:
  The result one is left with is thus a system of N-1 translationally invariant coordinates  and a center of mass coordinate , from iteratively reducing two-body systems within the many-body system.
  This change of coordinates has associated Jacobian equal to .
  If one is interested in evaluating a free energy operator in these coordinates, one obtains
  In the calculations can be useful the following identity