|
inlineconstexpr |
Computes the value of the Legendre and associated Legendre polynomials of order n
at x
:
Defined in header
Parameters
n
, m
: integral positive arguments.x
: real floating argument.Return value
The value of the polynomial at x
is returned.
The expression p_kind(legendre)(n,x)
is equivalent to legendre(n,x)
.
The expression q_kind(legendre)(n,x)
return the value at x
of the second kind legendre function of order n
.
Example
The expression successor(legendre)(l, x, ln, lnm1)
(or successor(legendre)(l, m, x, ln, lnm1)
) implements the three term recurrence relation for the (associated) Legendre polynomials, \(\displaystyle \mbox{P}^m_{l+1} =
\left((2l+1)\mbox{P}^m_{l}(x)-l\mbox{P}^m_{l-1}(x)\right)/(l+m+1)\) These functions can be used to create a sequence of values evaluated at the same x
and for rising l
. ( \(m = 0\) and no \(m\) in call are equivalent here).
Example
eve::condon_shortley
The expression condon_shortley(legendre)(l, m, x)
multiplies the associated legendre polynomial value by the Condon-Shortley phase \((-1)^m\) to match the definition given by Abramowitz and Stegun (8.6.6). This is currently the version implemented in boost::math 1.79.
Example
The expression sph(legendre)(l, m, theta)
returns the spherical associated Legendre function of degree l, order m, and polar angle theta in radian (that is the classical spherical harmonic with \(\phi = 0\)), i.e. \(\displaystyle
(-1)^mfrac{(2l+1)(l-m)!}{4\pi(l+m)!}\mbox{P}^m_{l}(\cos\theta)\)
Example