getGravitationalForce funciton