scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
legendre(n, monic=False)

Defined to be the solution of

$$\frac{d}{dx}\left[(1 - x^2)\frac{d}{dx}P_n(x)\right] + n(n + 1)P_n(x) = 0;$$

$P_n(x)$ is a polynomial of degree $n$ .

Notes

The polynomials $P_n$ are orthogonal over $[-1, 1]$ with weight function 1.

Parameters

n : int

Degree of the polynomial.

monic : bool, optional

If :None:None:`True`, scale the leading coefficient to be 1. Default is :None:None:`False`.

Returns

P : orthopoly1d

Legendre polynomial.

Legendre polynomial.

Examples

Generate the 3rd-order Legendre polynomial 1/2*(5x^3 + 0x^2 - 3x + 0):

>>> from scipy.special import legendre
... legendre(3) poly1d([ 2.5, 0. , -1.5, 0. ])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.special._orthogonal.legendre

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/special/_orthogonal.py#2395
type: <class 'function'>
Commit: