# getting the center of mass of each part of a molecule

```On Friday, May 19, 2017 at 4:17:23 PM UTC-7, qasi... at gmail.com wrote:
> The center of mass of the whole ligand that I calculated is the center of geometry (the average/mean atomic positions) from the sample input file provided. I don't take other things into account, such as knowledge of the mass of each atom and so on. The difference between the center of mass and the center of geometry/atom positions is probably small, and my aim is only to select the atom closest to the center of geometry.

Just a quick note, the image that you showed at the beginning of this discussion would not have picked C1 as the closest atom to the center of the molecule.  If your molecule consisted of only the benzene ring C1...C6, the center of mass would be exactly at the center.  Adding C7 would shift the center directly toward C2.  C8 and C9, as you have drawn them, shift the center further, in a direction pointing somewhere between C2 and C4.

> Dear Gregory Ewing, lets consider I get the center of geometry (the average positions of atoms - X, Y, Z) of the whole molecule. Then I can compare those average positions X, Y and Z and find the greatest one, and list separately the ligand atoms according to the greatest average position out of X, Y and Z (The greatest one is the "longest" axis of the molecule in some sense). This way, the ligand atoms will have been divided in two parts, right? After that, I can calculate the center of geometry of each part. Does this procedure make sense? If no, what do you suggest me to divide the ligand/molecule in two parts?

Any procedure that serves your intended purpose is the one that makes sense.  Personally, I don't understand the goal of dividing a molecule into two parts and then computing separate centers of mass for each, but maybe you can explain why this is a useful thing to do.

As you have described it, here is one possible way to proceed?

1) Identify "the" atom which is closest to the center of mass.  As I mentioned, there could be more than one atom which is the same distance from the center.  You need to define what to do in that case.
2) Rank the atoms in order of Euclidean distance from the center; choose "the one" that is farthest from the center.  Again, there could be ties.  What do you do?
4) Define a vector from the center to the most distant atom.
5) The plane that divides the molecule in half is defined as passing through "the" central atom, and is normal to the vector.

I'm not sure that's what you want.  Using this algorithm, the picture that you show would not divide the molecule in the way you describe.  I predict that C2 would be closest to the center of mass, so C2 would be the excluded atom.  C9 would be the most distant from the center of mass.  C1, C3, C5 and C6 would be on one side of the dividing plane.  C7, C8, and C9 would be on the other.  I'm not quite sure which side C4 would be on.

In your data table, you did not give coordinates for all 9 atoms.  With that information we could check whether your coordinates agree with your picture.

```