% Script File: square
% Plots the trigonometric interpolant.
clear
M=40
%A = linspace(0,360,2*M+1)';
D(2:M)=-1;D(M+2:2*M)=1;D(1)=0;D(M+1)=0;D(2*M+1)=0;
%=[ 408 89 -66 10 338 807 1238 1511 1583 1462 1183 804 408]';
D=D';

Avals = linspace(0,360,1000)';
F     = CSInterp(D(1:2*M));
Fvals = CSeval(F,360,Avals);
%F = fft(D);
fvals = interpft(D(1:2*M),1000);
xx=linspace(0,360,1000);

%plot(Avals,Fvals,A,D,'o')
plot(xx,fvals)
%plot(Avals,Fvals,Avals,fvals,'r')
%a = 170;b=235;
%axis([a b .985 1.035])
a=0;b=360;
set(gca,'xTick',linspace(a,b,M/4))
%xlabel('Ascension (Degrees)')
%ylabel('Declination (minutes)')
