Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double LegendreP(int l, int m, double X); | Associated Legendre function P(l,m,x) (Condon-Shortley phase). |
| 2 | float LegendreP(int l, int m, float X); | |
| 3 | double LegendreP(int l, double X); | Legendre polynomial P(l,x) = P(l,0,x) (order m = 0). |
| 4 | float LegendreP(int l, float X); | |
| 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). |
| 6 | void 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).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | l | int | Defines the Legendre degree parameter l (integer, l >= 0). |
| 2 | m | int | Defines the Legendre order parameter m, an integer on the closed interval [0,l]; otherwise NaN is returned. |
| 3 | X | double | Defines 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.
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).
Overload 2: float LegendreP(int l, int m, float X);
| # | Name | Type | Description |
|---|---|---|---|
| 1 | l | int | |
| 2 | m | int | |
| 3 | X | float |
Overload 3: double LegendreP(int l, double X);
Legendre polynomial P(l,x) = P(l,0,x) (order m = 0).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | l | int | Defines the Legendre degree parameter l (integer, l >= 0). |
| 2 | X | double | Defines 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.
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.
Overload 4: float LegendreP(int l, float X);
| # | Name | Type | Description |
|---|---|---|---|
| 1 | l | int | |
| 2 | X | float |
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).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | n | int | Defines the highest degree to evaluate; the result holds degrees 0..n (n must be >= 0). |
| 2 | X | double | Defines value at which the Legendre polynomials will be evaluated. Valid x values are real values on the closed interval [-1,1]. |
| 3 | result | TDenseMtxVec * | Returns the Legendre polynomials P(0,x), P(1,x), ..., P(n,x) in elements 0..n. |
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).
Overload 6: void LegendreP(int n, float X, TDenseMtxVec *result);
| # | Name | Type | Description |
|---|---|---|---|
| 1 | n | int | |
| 2 | X | float | |
| 3 | result | TDenseMtxVec * |