How to calculate the center of mass for a cloud of 3D spheres?

331 Views Asked by At

Given the spheres in 3D space: center(xi,yi,zi), radius and density and the info is stored in an array sphere_data[n][5]:


// Sphere_ID x y z radius density

1 x1 y1 z1 rad1 density_1

2 x2 y2 z2 rad2 density_2

...

n xn yn zn radn density_n


So how to calculate the center of mass for this cloud of 3D sphere?

Any tips or recommendation would be appreciate.

2

There are 2 best solutions below

2
On BEST ANSWER

If the center of the mass of the system is $(x,y,z)$, we then have $$x = \dfrac{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i x_i}{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i} = \dfrac{\sum_{i=1}^n r_i^3\rho_i x_i}{\sum_{i=1}^n r_i^3\rho_i}$$ $$y = \dfrac{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i y_i}{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i} = \dfrac{\sum_{i=1}^n r_i^3\rho_i y_i}{\sum_{i=1}^n r_i^3\rho_i}$$ $$z = \dfrac{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i z_i}{\sum_{i=1}^n \dfrac43\pi r_i^3\rho_i} = \dfrac{\sum_{i=1}^n r_i^3\rho_i z_i}{\sum_{i=1}^n r_i^3\rho_i}$$

0
On

Static balance. Taking moment of combined cloud of spheres or cubes and from that of the effect gravity point.Compute $ m_i = \rho_i \ r_i^3, \;\ x_i^2 + y_i^2 +z_i^2= r_i^2, $

$$ \bar X = \dfrac{\Sigma\ x_i m_i}{\Sigma \ m_i} ;\ \bar Y = \dfrac{\Sigma\ y_i m_i}{\Sigma \ m_i};\ \bar Z = \dfrac{\Sigma\ z_i m_i}{\Sigma \ m_i} ;\ $$