getting the center of mass of each part of a molecule
I think the problem is ambiguous as stated. There are many planes
you could pick through the centre of mass that divides the atoms
into two groups. Some other rule is needed to decide which is the
My guess is that what you have in mind involves finding the
"longest" axis of the molecule in some sense. That's easy to
determine visually, but not so easy when all you have to work
with is numbers.
One approach would be to find the axis around which the molecule
has the smallest moment of inertia. That involves finding the
eigenvectors of the rotational inertia matrix and picking the
one with the smallest eigenvalue.