function z = tp(A,B,t,m)
% z = tp(A,B,t,m)
% Evaluates the trigonometric polynomial created with tpcoeff.m
% A coefficients of cos(nx), input.
% B coefficients of sin(nx), input.
% t is the variable, input.
% m degree of the trigonomitric polynomial, input.
% z is the function value, output.
z = A(1);
for j = 1:m,
z = z + A(j+1)*cos(j*t) + B(j+1)*sin(j*t);
end