The spherical harmonics Y l m ( θ , ϕ ) {\displaystyle Y_{l}^{m}(\theta ,\phi )} are the angular portion of the solution to Laplace's equation in spherical coordinates. They are given by
where P n m {\displaystyle P_{n}^{m}} is the associated Legendre function.
The first few spherical harmonics are given by: