% polar plots of angular functions for l=3 (endelig versjon av fig42155-8-4, øving 8)
% senere erstattet av polarplott2.m
close all;
figure
t= linspace(-1.5*pi,-0.5*pi,200);t2=linspace(-0.5*pi,0.5*pi,200);
r=abs(5*(cos(t)).^3-3.*cos(t));r2=abs(5*(cos(t)).^3-3.*cos(t));
hold on
polar(t,r,'r')
h2=polar(t2,r2,'b')
  set(h2,'LineWidth',2);
hold off
figure(2)
th=linspace(0,2*pi,100);
Y30=sqrt(7/(16*pi))*(5*(cos(th)).^3-3.*cos(th));
x30=Y30.*sin(th);
y30=Y30.*cos(th);
hold on
%plot(x30,y30)
Y30=sqrt(7/(16*pi))*(5*(cos(th)).^3-3.*cos(th));
fortegn=sign(Y30);
x=Y30.*sin(th).*fortegn; y=Y30.*cos(th).*fortegn;
plot(x,y,'Linewidth',2)
xz=0.*th; yz=Y30(1).*(th-pi)/pi;
line(xz,yz)
Y31=sqrt(21/(64*pi)).*sin(th).*(5*(cos(th)).^2-1);
fortegn=sign(Y31);
x=Y31.*sin(th).*fortegn; y=Y31.*cos(th).*fortegn;
plot(x+0.7,y,'Linewidth',2)
xz31=0.*th; yz31=0.5.*(th-pi)/pi;
line(xz31+0.7,yz31)
Y32=sqrt(105/(32*pi))*(sin(th)).^2.*cos(th);
fortegn=sign(Y32);
x=Y32.*sin(th).*fortegn; y=Y32.*cos(th).*fortegn;
plot(x+1.4,y,'Linewidth',2)
%xz=0.*th; yz=Y(1).*(th-pi)/pi;
line(xz31+1.4,yz31)
Y33=sqrt(35/(64*pi))*(sin(th)).^3;
fortegn=sign(Y33);
x=Y33.*sin(th).*fortegn; y=Y33.*cos(th).*fortegn;
plot(x+2.2,y,'Linewidth',2)
%xz=0.*th; yz=Y(1).*(th-pi)/pi;
line(xz31+2.2,yz31)
axis off;axis equal
text(-0.05,0.8,'Fig 1');text(0.65,0.8,'Fig 2');text(1.35,0.8,'Fig 3');text(2.05,0.8,'Fig 4');
%%%%%%%%%%%%%%%%%%%%%%%print -dpng fig42155-8-4.png


hold off
