X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=legendre_p_tilde.m;h=2c9d2ab08916107fe11ca42ba863f32e4341117f;hp=e5e6f63b39b929731c3c8281f59b4510fbbf494c;hb=4c1c0fdc1eab7fbe1e322ff651e9c98357a8ce15;hpb=ee06b882dfb9a86788d7057cec8ca6d7680c5ca5 diff --git a/legendre_p_tilde.m b/legendre_p_tilde.m index e5e6f63..2c9d2ab 100644 --- a/legendre_p_tilde.m +++ b/legendre_p_tilde.m @@ -1,7 +1,7 @@ function P_tilde = legendre_p_tilde(n, a, b) - ## Return the nth Legendre polynomial scaled to the interval [a,b]. + ## Return the `n`th Legendre polynomial scaled to the interval [a,b]. ## - ## INPUTS: + ## INPUT: ## ## * ``n`` - The index of the polynomial that we want. ## @@ -9,7 +9,7 @@ function P_tilde = legendre_p_tilde(n, a, b) ## ## * ``b`` - The right endpoint of the interval. ## - ## OUTPUTS: + ## OUTPUT: ## ## * ``P_tilde`` - A polynomial function of one argument. ## @@ -17,8 +17,9 @@ function P_tilde = legendre_p_tilde(n, a, b) ## Can't do anything here. Return nothing. P = NA; else - ## Compute the Legendre polynomial over [-1,1] and mangle it. - P = legendre_p(n) - P_tilde = @(x) P( (2/(b-a))*x + 1 - (2*b)/(b-a) ) + ## Compute the Legendre polynomial over [-1,1] and mangle it to fit + ## the interval [a,b]. + P = legendre_p(n); + P_tilde = @(x) P( (2/(b-a)).*x + 1 - (2*b)/(b-a) ); end end