function rcm = cm_locationMatrix(rMatrix, mMatrix)
tempMatrix = rMatrix .* mMatrix;
totalMass = sum(mMatrix);
rcm = [sum(tempMatrix(1,:))/ totalMass, sum(tempMatrix(2,:))/totalMass];
%rcm = (r1 .*m1 + r2 .*m2)/(m1 + m2);