plegendre
Introduced in 2.2.1
Synopsis

Legendre polynomials and Associated Legendre polynomials.

v = plegendre(L,x)
v = plegendre(L,M,x)
Description

With two input arguments, plegendre returns the value(s) of the Legendre polynomal of degree L (with L ≥ 0). With three input arguments, the value(s) of the associated Legendre polynomal of degree L (with L ≥ 0) and order M (with |M| ≤ L) are returned.

x must satisfy -1≤ x ≤ +1 and can be a scalar or an array.

Algorithm

plegendre is using recurrence relations to compute the values, as described in Press et al, Numerical Recipes in C++ (2002). Note that contrary to that reference, but in line with most others, the Condon-Shortley phase factor (-1)^m is not included in plegendre. It is included in the spherical harmonics computed by spherharm.

See also

clebschgordan, spherharm, wigner3j, wigner6j