1 function P_tilde = legendre_p_tilde(n, a, b)
2 ## Return the nth Legendre polynomial scaled to the interval [a,b].
6 ## * ``n`` - The index of the polynomial that we want.
8 ## * ``a`` - The left endpoint of the interval.
10 ## * ``b`` - The right endpoint of the interval.
14 ## * ``P_tilde`` - A polynomial function of one argument.
17 ## Can't do anything here. Return nothing.
20 ## Compute the Legendre polynomial over [-1,1] and mangle it.
22 P_tilde = @(x) P( (2/(b-a)).*x + 1 - (2*b)/(b-a) );