How to find centre of mass of an object