/** * Recurrence coefficients for the first theta-derivative of orthonormal * associated Legendre functions (Condon-Shortley phase included), matching * the alpha^+/alpha^- recurrence in evolving_surface/notes/algos.tex Sec 2.1: * * sin(theta) d/dtheta Y_l^m = alpha^+(l,m) Y_{l+1}^m + alpha^-(l,m) Y_{l-1}^m * * so the coefficients of sin(theta)*dtheta(u), by degree, are * * v_l^m = alpha^+(l-1,m) u_{l-1}^m + alpha^-(l+1,m) u_{l+1}^m * * dropping any term referring to a degree outside 0 <= l <= lmax. Baked to * zero at each m-block's first/last element (rather than left undefined), so * a consuming WGSL kernel needs only an in-bounds check, not a validity check. */ import { lmIndex, nlmCalc } from './layout.ts'; export interface DerivCoeffs { /** aPlus[lm] = alpha^+(l-1,m) when l>m, else 0 -- multiplies u_{l-1}^m. */ aPlus: Float64Array; /** aMinus[lm] = alpha^-(l+1,m) when l= m) aPlus[lm] = alphaPlus(l - 1, m); if (l + 1 <= lmax) aMinus[lm] = alphaMinus(l + 1, m); } } return { aPlus, aMinus, mOf }; }