function pn = Chebyshev(n)
% compute n'th order Chebyshev polynomial of the first kind
% initialize (-1)'th and zero'th order polynomials
pA = [1];
pB = [1 0];

if n == 0 
  pn = [1];
elseif n == 1;
  pn = [1,0];
else
  for i=2:n
    pn = (2*[pB,0] - [0,0,pA]);
    pA = pB;
    pB = pn;
  end%for
end%if
