spherical_parts

Function spherical_parts 

Source
fn spherical_parts<const DERIVATIVES: bool>(
    l: i32,
    k: Complex,
    position: [f64; 3],
    r2: f64,
    solid: &Solid,
    [c, e, f]: [Complex; 3],
    scale: f64,
) -> [VectorWave; 2]
Expand description

The unnormalized parts [n, m] of a spherical wave of degree l, which every polarization combines with its own weights.

With the scaled radial function c = z_l(kr) / r^l and the solid harmonic S = r^l P_l^m(cos theta) e^(i m phi), the scalar wave is psi = c S. Then m = r x grad psi, the negative of the unnormalized M = curl(r psi) = grad psi x r, and n is the unnormalized N. The inputs are the scaled radial functions of orders l, l + 1 and l + 2; the last one enters only the derivatives. scale returns the derivatives from the internal length unit to the caller’s unit.