Menu

#1110 GeometryTools has a misleading 'calculate center' method

open
5
2012-10-08
2010-11-03
No

The GeometryTools class has a translate2DCenterTo(x, y) method that uses the get2DCenter method. This works, but the implementation is slightly wrong. It calculates the center of mass (average of atom coords), not the center of the bounding box. Note that there is a get2DCenterOfMass method that actually uses the mass (atom.getExactMass), but this is not what I am referring to.

For an example of why this is a problem, consider a buckyball with a long carbon chain attached. The averaged coordinate center will be in the fullerene part, but the center of the bounding box will be quite different. I suggest either a) better documentation or b) more methods, with clearer naming conventions.

Discussion