function yy=NewtonInterpolation(x,d,xx)
% NEWTONINTERPOLATION interpolate using the Newton polynomial
%   yy=NewtonInterpolation(x,d,xx); uses the points (x,.)
%   and the precalculated divided difference coefficients d for the
%   Newton form of the interpolation polynomial P and iterpolates
%   the values yy=P(xx) 

n=length(x)-1; 
yy=d(n+1);
for i=n:-1:1
  yy=yy.*(xx-x(i))+d(i);
end;