function P_tilde = legendre_p_tilde(n, a, b)
  ## Return the nth Legendre polynomial scaled to the interval [a,b].
  ##
  ## INPUTS:
  ##
  ##   * ``n`` - The index of the polynomial that we want.
  ##
  ##   * ``a`` - The left endpoint of the interval.
  ##
  ##   * ``b`` - The right endpoint of the interval.
  ##
  ## OUTPUTS:
  ##
  ##   * ``P_tilde`` - A polynomial function of one argument.
  ##
  if (n < 0)
    ## 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) )
  end
end
