What it is
This calculator evaluates the complex spherical harmonic \(Y_n^m(\theta,\phi)\), the angular part of the solutions to Laplace's equation. Spherical harmonics appear throughout physics and applied mathematics: quantum mechanics (atomic orbitals), electromagnetics, geodesy, computer graphics lighting, and seismology. The tool reports the real part, imaginary part and magnitude of Y at a chosen polar (zenith) angle theta and fixed azimuthal angle phi. It is pure mathematics and applies identically everywhere.
How to use it
Pick a function definition. Type A is the fully normalized, orthonormal Condon-Shortley convention used in quantum mechanics (the integral of \(|Y|^2\) over the sphere equals 1). Type B is the unnormalized convention, simply \(P_n^m(\cos\theta)\) times the azimuthal phase. Enter the degree \(n\) (0, 1, 2, ...), the order \(m\) with \(-n \le m \le n\), the zenith angle theta in degrees and the azimuthal angle phi in degrees. Submit to read the real and imaginary parts.
The formula explained
$$Y_n^m(\theta,\phi) = N_{n,m}\cdot P_n^m(\cos\theta)\cdot e^{i\,m\phi}$$ where \(e^{i\,m\phi} = \cos(m\phi) + i\sin(m\phi)\). The associated Legendre function \(P_n^m\) carries the Condon-Shortley phase \((-1)^m\). For type A, $$N = \sqrt{\frac{2n+1}{4\pi}\cdot\frac{(n-m)!}{(n+m)!}}$$ for type B, \(N = 1\). Angles entered in degrees are converted to radians before evaluation.
Worked example
Type A, \(n = 2\), \(m = 1\), \(\theta = 30\degree\), \(\phi = 30\degree\). Then \(x = \cos 30\degree = 0.8660254\), \(P_2^1(x) = -\sqrt{1-x^2}\cdot 3x = -1.2990381\), and $$N = \sqrt{\frac{5}{4\pi}\cdot\frac{1}{6}} = 0.2575162.$$ So \(N\cdot P = -0.3345283\). With \(\cos 30\degree = 0.8660254\) and \(\sin 30\degree = 0.5\), the real part is \(-0.2897113\) and the imaginary part is \(-0.1672642\); the magnitude is \(0.3345283\).
FAQ
What is the valid range of m? The order \(m\) must be an integer with \(-n \le m \le n\). Otherwise the harmonic is undefined.
Why is Y zero at the poles? At \(\theta = 0\degree\) or \(180\degree\), \(\sqrt{1-x^2} = 0\), so \(P_n^m = 0\) for every \(m \ne 0\); only \(m = 0\) stays finite.
Which sign convention is used? The Condon-Shortley phase \((-1)^m\) is included, matching the standard physics convention.