legendre_polynomial, a MATLAB code which evaluates the Legendre polynomial and associated functions.
The Legendre polynomial P(n,x) can be defined by:
P(0,x) = 1 P(1,x) = x P(n,x) = (2*n-1)/n * x * P(n-1,x) - (n-1)/n * P(n-2,x)where n is a nonnegative integer.
The N zeroes of P(n,x) are the abscissas used for Gauss-Legendre quadrature of the integral of a function F(X) with weight function 1 over the interval [-1,1].
The Legendre polynomials are orthogonal under the inner product defined as integration from -1 to 1:
Integral ( -1 <= x <= 1 ) P(i,x) * P(j,x) dx = 0 if i =/= j = 2 / ( 2*i+1 ) if i = j.
The computer code and data files described and made available on this web page are distributed under the MIT license
legendre_polynomial is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
bernstein_polynomial, a MATLAB code which evaluates the bernstein polynomials, useful for uniform approximation of functions;
chebyshev_polynomial, a MATLAB code which considers the chebyshev polynomials t(i,x), u(i,x), v(i,x) and w(i,x). functions are provided to evaluate the polynomials, determine their zeros, produce their polynomial coefficients, produce related quadrature rules, project other functions onto these polynomial bases, and integrate double and triple products of the polynomials.
gegenbauer_polynomial, a MATLAB code which evaluates the Gegenbauer polynomial and associated functions.
hermite_polynomial, a MATLAB code which evaluates the physicist's hermite polynomial, the probabilist's hermite polynomial, the hermite function, and related functions.
jacobi_polynomial, a MATLAB code which evaluates the jacobi polynomial and associated functions.
laguerre_polynomial, a MATLAB code which evaluates the laguerre polynomial, the generalized laguerre polynomial, and the laguerre function.
legendre_product_polynomial, a MATLAB code which defines legendre product polynomials, creating a multivariate polynomial as the product of univariate legendre polynomials.
legendre_rule, a MATLAB code which computes a 1d gauss-legendre quadrature rule.
legendre_shifted_polynomial, a MATLAB code which evaluates the shifted legendre polynomial, with domain [0,1].
lobatto_polynomial, a MATLAB code which evaluates lobatto polynomials, similar to legendre polynomials except that they are zero at both endpoints.
pce_legendre, a MATLAB code which assembles the system matrix of a 2d stochastic pde, using a polynomal chaos expansion in terms of legendre polynomials;
polpak, a MATLAB code which evaluates a variety of mathematical functions.
test_values, a MATLAB code which supplies test values of various mathematical functions.