Spherical Harmonics may help. The field of any bounded body can be expressed as where
Yjm(θ, φ) = eimφPjm(cosθ) and
Pjm(x) = (−1)m(1 − x2)m/2(DmPj)(x) where D is the derivative operator.

P0(x) = 1.
P1(x) = x.
(n+1)Pn+1(x) = (2n+1)xPn(x) − nPn−1(x).
?