function pinter2(f)

% Given Fourier coefficients, this routine evaluates the interior using
% FFT and fz and plots equipotential lines with calcomp graphics.

tpi = 2*pi;
fprintf('Enter the number of points to plot = 2 ^ mp\n');
mp = input('mp = ');
np = 2^mp;
nr = input('Enter the number of circles map is evaluated at: ');
nth = input('Enter the number of radial lines: ');
nt = input('Enter the number of points to plot in a radial line: ');

ang = 0:tpi/np:tpi - tpi/np;
wz = cos(ang) + i*sin(ang);
N = length(f);
c = fft(f)./N;

% f(z) = c(1) + c(2) * z + ... + c(N) * z ^ (N - 1)

% Evaluate along circles of constant radius using FFT's.
ri = 1/nr;
for j = 1:nr
   r = j*ri;
   k = 1:N;
   f(k) = c(k).*r.^(k - 1);  
   if np ~= N 
      f(N + 1:np) = zeros(1, np - N);
   end
   f = np*ifft(f);
   plot([f f(1)]);
   hold on;
end

% Evaluate along spoke lines using Horners algorithm.
for j = 1:nth 
   ang = tpi*(j - 1)/nth;
   wv = cos(ang) + i*sin(ang);
   k = 1:nt;
   z = k/nt*wv;
   p = c(N:-1:1);
   fz = polyval(p, z);
   plot(fz);
   hold on; 
end

axis('equal');
hold off