]> gitweb.michael.orlitzky.com - octave.git/blobdiff - legendre_p_tilde.m
Add diffusion_matrix_sparse() and its tests.
[octave.git] / legendre_p_tilde.m
index e5e6f63b39b929731c3c8281f59b4510fbbf494c..2c9d2ab08916107fe11ca42ba863f32e4341117f 100644 (file)
@@ -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