Any two point bodies with masses m1 and m2 will attract each other with a force directed along the line joining their centers of magnitude
F=Gm1m2
r2
where r is the distance between the centers. The quantity G is called the universal gravitational constant. Its value in SI units is G=6.67×10-11Nm2kg-2. This is a very small value so the gravitational force is normallu only important for very large masses.
Note: This is a force like any other so gravitational forces add as vectors.
Kepler (preceding Newton, whose law explains it) found that when two bodies move under the influence of their mututal gravitational force then the orbits are elliptical.
He also found that the square of the orbital period is proportional to the cube of the orbital radius.
(We proved this in class for the special case of a circular orbit.)
Near to the Earth's surface the change in gravitational force with distance from the center of the earth is so slight that the gravitational attraction appears constant so we have
mg=GMm or g=GM.
r2 r2