where r is radial distance from the Earth's center, N is the maximum degree of the expansion, ϕ ϕ is East longitude, θ θ is colatitude (the polar angle), a is the Earth's radius, g n m and h n m are Gauss coefficients, and P n m ( cos ⁡ ⁡ θ θ ) are the Schmidt quasi-normalized associated Legendre functions of degree n and order m