% Script File: sawtooth_wave.
clear
M=512
A = linspace(0,360,2*M+1)';
D(2:M)=(2:M)/M;D(M+2:2*M)=-1+(2:M)/M;D(1)=0;D(M+1)=0;D(2*M+1)=0;
D=D';

Avals = linspace(0,360,1024)';
F     = CSInterp(D(1:2*M));
Fvals = CSeval(F,360,Avals);

%plot(Avals,Fvals,A,D,'o')
plot(Avals,Fvals)
a = 160;b=180;
axis([a b .89 1.1])
set(gca,'xTick',linspace(a,b,M/4))
xlabel('Ascension (Degrees)')
ylabel('Declination (minutes)')