ang1 = 30;
ang2 = -120;
t = 0:.001:1;
zero_to_one = .5*(1-cos(pi*t));
theta1 = ang1 + (ang2-ang1)*zero_to_one;

figure(1); clf
subplot(211)
plot(t,zero_to_one); legend('scaled and shifted cosine')
title('Lab 4 example trajectory (with smoothing)')
subplot(212)
plot(t,theta1); legend('smoothed trajectory example')