% WaterHCI logo-generator script.  S. Mann, 2021 (based on 1998 design, S. Mann)
% The WaterHCI logo in 3D is both an artistic and scientific creation.
% The 3D logo consists of a complex-valued exponential function in 3D
% above the mathematical ᛗ<sub>∞</sub> (or finite) function also shown in 3D,
% both as plots of real versus imaginary (Argand plane, i.e. the complex plane)
% versus time or space.

tet=8*atan(1) % teth is a full circle which equals 2*pi
o=tet/360 % one degree which is 1/360th of a full circle
tau=90*o % quarter circle: use Greek letter tau if not used elsewhere
pi=180*o % pi
tet=360*o % tet

%t=(0:1023)/1024; % timebase
t=(0:1535)/512; % timebase
x=cos(tet*t);
y=sin(tet*t);
%plot3(t,x,y);
x7=sin(tet*t)+1/3*sin(3*tet*t)+1/5*sin(5*tet*t)+1/7*sin(7*tet*t);
xs=sin(tet*t)+1/3*sin(3*tet*t)+1/5*sin(5*tet*t)+1/7*sin(7*tet*t)+1/9*sin(9*tet*t);
y7=cos(tet*t)-1/3*cos(3*tet*t)+1/5*cos(5*tet*t)-1/7*cos(7*tet*t);
ys=cos(tet*t)-1/3*cos(3*tet*t)+1/5*cos(5*tet*t)-1/7*cos(7*tet*t)+1/9*cos(9*tet*t);

K=31
xs=sin(tet*t)
for k=3:2:K;
 xs=xs+1/k*sin(k*tet*t);
end%for
ys=cos(tet*t)
for k=3:2:K;
 ys=ys+ (-1)^((k-1)/2) /k*cos(k*tet*t);
end%for

w=5 % linewidth
w=3 % linewidth

clf
plot3(xs,ys,t+1,'-g','linewidth',w)
hold on
plot3(xs,ys,'-r','linewidth',w)
plot3(x,y+2,t+1,'-b','linewidth',w)
axis([-2 2 -4 4 0 5])
axis("equal")
plot3(x,y+2,'-r','linewidth',w)
%plot3(x,y,t,";helix;")

