plegendre

Legendre polynomials and associated Legendre polynomials.

Syntax
v = plegendre(L,z)
v = plegendre(L,M,z)
v = plegendre(L,M,z,CSphase)
Description

With two input arguments, plegendre returns the value(s) of the Legendre polynomial of degree L (with L ≥ 0).

With three or four input arguments, plegendre calculates the value(s) of the associated Legendre polynomial of degree L (with L ≥ 0) and order M (with -L ≤ M ≤ L).

z are the values for which to evaluate the polynomial. z must satisfy -1≤ z ≤ +1 and can be a scalar or an array.

The optional input CSphase (true or false) specifies whether the Condon-Shortley phase (-1)M should be included (true) or not (false). The default is true.

Algorithm

plegendre uses recurrence relations to compute the values, as described e.g. in Press et al, Numerical Recipes in C++ (2002).

See also

clebschgordan, spherharm, wigner3j, wigner6j, wignerd