The variation of gravitational acceleration (g) on Earth is mostly influenced by the fact that Earth is not a perfect sphere — it is slightly flattened at the poles and bulged at the equator, so a point on the equator is farther from the center of gravity. Since the gravitational field weakens with distance, the gravitational force on objects located at the equator is smaller. Because of this alone, g is 0.18% smaller at the equator than at the poles.

Earth’s rotation also adds a centrifugal force that acts in the opposite direction to gravity. This force is greatest at the equator and zero at the poles. Combined with the change in distance from the center of mass, it reduces g by 0.53% at the equator compared to the poles.

The formula that calculates g depending on geographic latitude, taking into account both Earth’s shape and rotation, is:

$$ \begin{array}{l} g=g_{45}-{\tfrac {1}{2}}(g_{\mathrm {poles} }-g_{\mathrm {equator} })\cos \left(2,lat,{\frac {\pi }{180}}\right) \end{array} $$

We know that:

$g_{\mathrm{poles}} = 9.832 , \text{m/s}^2$

$g_{45} = 9.806 , \text{m/s}^2$

$g_{\mathrm{equator}} = 9.780 , \text{m/s}^2$

$lat = \text{geographical latitude between } -90^\circ \text{ and } +90^\circ$

The formula assumes the object is at sea level (altitude = 0). If we want to take altitude into account, the formula becomes:

$$ g_{h} = g_{0} \left( \frac{r_{\mathrm{e}}}{r_{\mathrm{e}} + h} \right)^2 $$

$r_e$ is the mean radius of Earth (6,371.0088 km)

$g_0$ is the standard gravitational acceleration (9.80665 $m/s^2$)

The actual variation of gravitational acceleration with altitude is more complex, as the local density of Earth’s crust also changes with height. I don’t think that’s very important for now.