legendre0 edit page

Evaluate all Legendre polynomials up to degree N in x and returns a matrix of the function values 1st dimension -> degree 2nd dimension -> x Use the recurence formula (n+1)*P_{n+1} = (2n+1)*x*P_n - n*P_{n-1}

Syntax

l = legendre0(N,x)

Input

N degree
x input nodes

Output

l function evaluations

Example