Calculation of gravitational force and mass