## -*- texinfo -*-
## @deftypefn {Function File} {} polytranscale (@var{f},@var{a},@var{b})
## Return the coefficients of the shifted,scaled polynomial whose
## coefficients are given by vector @var{f}.  If @var{f} is the
## vector representing the polynomial f(x), then
## @var{g} = polytranscale(@var{f}, @var{a}, @var{b}) is the vector
## representing g(x) = f((x+b)*a).
##
## Here is a simple example that will plot both the original and
## translated (shifted) and scaled polynomials.  f is a third order 
## polynomial.  g is a polynomial obtained after translation one unit
## to the right and then scaling f by 2 (compression):
##
## f = [1/5 4/5 -7/5 -2];
##
## g = polytransscale(f, 2, -1);
##
## x = linspace(-4,4,100);
##
## plot(x,polyval(f,x),x,polyval(g,x));
##
## axis([-4 4 -3 5]);
##
## grid("on");
## @seealso{polyscale, polytranscale}
## @end deftypefn

## Author: Tony Richardson <richardson@evansville.edu)
## Created: April 2009


function g = polytranscale(f, a, b)
 
   if(nargin != 3)
      print_usage ();
   endif

   if(! isvector(f) )
      error("polytranscale: first argument must be a vector.");
   endif

   if(! (isscalar(a) && isscalar(b)))
      error("polytranslate: second and third arguments must be a scalars.");
   endif

   g = polyscale(polytranslate(f,b), a);

endfunction
