pub fn sph_harm_y(n: usize, m: isize, theta: f64, phi: f64) -> Complex64Expand description
Spherical harmonics
Corresponds to scipy.special.sph_harm_y.
§Definition
$$ Y_n^m(\theta, \phi) = \sqrt{ {2n + 1 \over 4\pi} {(n - m)! \over (n + m)!} } \ P_n^m(\cos \theta) \ e^{i m \phi} $$
where $P_n^m$ are the (unnormalized) associated Legendre polynomials.
With SciPy’s convention, the first several spherical harmonics are
$$ \begin{align*} Y_0^0(\theta, \phi) &= \sqrt{1 \over 4\pi} \\ Y_1^{-1}(\theta, \phi) &= \sqrt{3 \over 8\pi} \ \sin \theta \ e^{-i \phi} \\ Y_1^0(\theta, \phi) &= \sqrt{3 \over 4\pi} \ \cos \theta \\ Y_1^1(\theta, \phi) &= -\sqrt{3 \over 8\pi} \ \sin \theta \ e^{ i \phi} \end{align*} $$
§Panics
- if
nis greater thanc_int::MAX - if
mis greater thanc_int::MAX