%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Simple program to test rotation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; clf

X = linspace(0,10,101);
Y = sin(X);

%  Plot original function
subplot(2,2,1)
plot(X,Y)
title('Original Function')
pause

%  Rotate through 45 degrees.
theta = 45 * (pi/180);
x =  cos(theta)*X - sin(theta)*Y;
y =  sin(theta)*X + cos(theta)*Y;
subplot(2,2,2)
plot(x,y)
pause

%  Rotate through -45 degrees.
theta = -45 * (pi/180);
x =  cos(theta)*X - sin(theta)*Y;
y =  sin(theta)*X + cos(theta)*Y;
subplot(2,2,3)
plot(x,y)
pause

%  Rotate through 90 degrees.
theta = 90 * (pi/180);
x =  cos(theta)*X - sin(theta)*Y;
y =  sin(theta)*X + cos(theta)*Y;
subplot(2,2,4)
plot(x,y)

return