Center of mass of two masses
(m1+m2)xcm=m1x1+m2x2
For two masses: xcm=m1x1+m2x2m1+m2
Center of mass for N masses
Mtot→rcm=∑Ni=1mi→ri=m1→r1+m2→r2+m3→r3+⋯+mN→rN
→rcm=1Mtot∑Ni=1mi→ri=m1→r1+m2→r2+m3→r3+⋯+mN→rNMtot
xcm=∑Ni=1mixiMycm=∑Ni=1miyiMzcm=∑Ni=1miziM