kylelutz / chemkit

A C++ library for molecular modelling, cheminformatics and molecular visualization.
http://www.chemkit.org
BSD 3-Clause "New" or "Revised" License
54 stars 26 forks source link

Error in weightedCenter function #32

Closed janvc closed 9 years ago

janvc commented 10 years ago

There is an error in the function CartesianCoordinates::weightedCenter().

After summing the coordinates with their respective weights, the results gets divided by the total mass times the number of particles. This is not correct. It should only be divided by the total mass.

kylelutz commented 9 years ago

Merged in your fix. Thanks!