function [wam,theta] = wamlissa(deg);

% 3d WAM on Lissajous curves of [-1,1]^3

if mod(deg,2) == 0
a=3/4*deg^2+deg/2;b=3/4*deg^2+deg;c=3/4*deg^2+3/2*deg+1;
else
a=3/4*deg^2+1/4;b=3/4*deg^2+3/2*deg-1/4;c=3/4*deg^2+3/2*deg+3/4; 
end;

mu=c*deg+1;
theta=(0:mu)*pi/mu;
wam=[cos(a*theta') cos(b*theta') cos(c*theta')];

% mu=c*deg;
% theta=(2*(0:mu)+1)*pi/(2*mu+2);
% wam=[cos(a*theta') cos(b*theta') cos(c*theta')];

plot3(wam(:,1),wam(:,2),wam(:,3),'o');
hold on;
t=linspace(0,pi,1000);
plot3(cos(a*t'),cos(b*t'),cos(c*t'));


end


