A History of the Mathematical Theories of Attraction and the Figure of the Earth