SpecialFuncs::LegendreP Function

Overload List

#SignatureDescription
1double LegendreP(int l, int m, double X);Associated Legendre function P(l,m,x) (Condon-Shortley phase).
2float LegendreP(int l, int m, float X);
3double LegendreP(int l, double X);Legendre polynomial P(l,x) = P(l,0,x) (order m = 0).
4float LegendreP(int l, float X);
5void LegendreP(int n, double X, TDenseMtxVec *result);Vector of Legendre polynomials P(0,x), P(1,x), ..., P(n,x) (order m = 0).
6void LegendreP(int n, float X, TDenseMtxVec *result);

Overload 1: double LegendreP(int l, int m, double X);

Associated Legendre function P(l,m,x) (Condon-Shortley phase).

#NameTypeDescription
1lintDefines the Legendre degree parameter l (integer, l >= 0).
2mintDefines the Legendre order parameter m, an integer on the closed interval [0,l]; otherwise NaN is returned.
3XdoubleDefines value at which the Legendre function will be evaluated. Valid x values are real values on the closed interval [-1,1]; otherwise NaN is returned.

Returns: The associated Legendre function P(l,m,x) with the Condon-Shortley phase, or NaN when the parameters are out of domain.

Remarks:

Computes the associated Legendre function of degree l and order m, including the Condon-Shortley phase factor (-1)^m, by the standard upward recurrence in l. With P_l^m derived from the Legendre polynomial P_l by

P_l^m(x)=(-1)^m (1-x^2)^(m/2) d^m/dx^mP_l(x), m=0,1,...,l,

the function uses P_m^m(x)=(-1)^m(2m-1)!!\,(1-x^2)^{m/2}, P_{m+1}^m(x)=x\,(2m+1)\,P_m^m(x) and the recurrence (l-m)\,P_l^m=x(2l-1)P_{l-1}^m-(l+m-1)P_{l-2}^m.
Domain: integer l\ge 0, integer m on [0,l], and real x on the closed interval [-1,1]. Defined behavior on invalid input: if m<0, m>l, or |x|>1 the function returns NaN. The order-zero case P(l,0,x) equals the ordinary Legendre
polynomial P_l(x).

Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler

Overload 2: float LegendreP(int l, int m, float X);

#NameTypeDescription
1lint
2mint
3Xfloat
Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler

Overload 3: double LegendreP(int l, double X);

Legendre polynomial P(l,x) = P(l,0,x) (order m = 0).

#NameTypeDescription
1lintDefines the Legendre degree parameter l (integer, l >= 0).
2XdoubleDefines value at which the Legendre polynomial will be evaluated. Valid x values are real values on the closed interval [-1,1]; otherwise NaN is returned.

Returns: The Legendre polynomial P(l,x) = P(l,0,x), or NaN when |x| > 1.

Remarks:

Computes the ordinary Legendre polynomial of degree l, i.e. the associated Legendre function at order m = 0:

P_l(x)=1/(2^l l!)d^l/dx^l(x^2-1)^l, P_0=1, P_1=x, (l+1)P_(l+1)=(2l+1)x P_l-l P_(l-1).

Domain: integer l\ge 0 and real x on the closed interval [-1,1]. Defined behavior: returns NaN when |x|>1. Known values: P_l(1)=1 and P_l(-1)=(-1)^l.

Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler

Overload 4: float LegendreP(int l, float X);

#NameTypeDescription
1lint
2Xfloat
Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler

Overload 5: void LegendreP(int n, double X, TDenseMtxVec *result);

Vector of Legendre polynomials P(0,x), P(1,x), ..., P(n,x) (order m = 0).

#NameTypeDescription
1nintDefines the highest degree to evaluate; the result holds degrees 0..n (n must be >= 0).
2XdoubleDefines value at which the Legendre polynomials will be evaluated. Valid x values are real values on the closed interval [-1,1].
3resultTDenseMtxVec *Returns the Legendre polynomials P(0,x), P(1,x), ..., P(n,x) in elements 0..n.
Remarks:

Fills result with the sequence of ordinary Legendre polynomials evaluated at x:

result[l]=P_l(x), l=0,1,...,n,

using the three-term recurrence (l+1)P_{l+1}=(2l+1)x\,P_l-l\,P_{l-1} with P_0=1, P_1=x. The result operand is auto-sized to length n+1 and its precision matches the operand (single or double). Domain: integer n\ge 0 and real x on the closed interval [-1,1]. Defined behavior: an exception is raised if result is complex or if n<0; for |x|>1 each element follows the scalar contract (NaN).

Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler

Overload 6: void LegendreP(int n, float X, TDenseMtxVec *result);

#NameTypeDescription
1nint
2Xfloat
3resultTDenseMtxVec *
Declared in Dew::Math::Units::SpecialFuncs · Dew.Math/Units.SpecialFuncs.h · Cross-compiler