The origin of Legendre's Polynomials