% Drawing a Pretty sinusoidal surface
% Jeffrey N. Denenberg
% February 14, 2012
% preallocate memory for a vector
fprintf('\nFirst create a vector of the first half wave of a sine wave\n')
size=100;
halfsine=zeros(size);
for n=1:100
    halfsine(n)=sin((n*2*pi())/(2*size));
end
plot(halfsine)
pause
fprintf('\nNow create a vector of full wave of a sine wave\n')
size=100;
fullsine=zeros(size);
for n=1:100
    fullsine(n)=sin((n*2*pi())/(size));
end
plot(fullsine)
pause
fprintf('\nNow create a 3D surface by cross multiplying\n')
surface=halfsine*fullsine';
surf(surface)
fprintf('\nDone!\n')
