figure
x=lm(:,1);
y=lm(:,2);
z=lm(:,3);
plot3(x, y, z,'k.','MarkerSize',5)
xlabel('X','Fontsize',13),ylabel('Y','Fontsize',13),zlabel('Z','Fontsize',13);
grid on
hold on
lmidx = [31,37,40,43,46,49,55];
te=lmidx;
plot3(x(te), y(te), z(te),'r.','MarkerSize',9)
plot3(x(1), y(1), z(1),'b.','MarkerSize',9)
plot3(x(68), y(68), z(68),'g.','MarkerSize',9)
%%
figure
hold on
x=lm(:,1);
y=lm(:,2);
plot(x, y,'b.','MarkerSize',10)
%{
f_d(phi0)=cosh(0-PHI)^2;
f_d(phi45)=cosh(45-PHI)^2;
f_d(phi90)=cosh(90-PHI)^2;
f_d(phi135)=cosh(135-PHI)^2;
%}
% syms x
% [x,params,conds]=solve(sin(x)==1,'ReturnConditions', true)
% syms a b c y x
% [x,y]=solve([a*x^2+b*y+c==0,a*x+2*y==4],[x,y])
% syms theta k
syms I0 I90 I45 I135 Imax Imin
[Imax,Imin]=solve([Imax==()]);
DRAW
phi=-3.14:0.01:3.14;
y=cos(phi).*cos(phi);
y1=0.18*ones(1,size(phi,2));
newy=y+y1;
figure,plot(phi,newy,'linewidth',3)
set(gca,'YLim',[0 1.3])
set(gca,'XLim',[-3.15 3.15])
hold on
plot(phi,y,'g','linewidth',2)
hold on
plot(phi,y1,'r','linewidth',2)
legend('Natural light','Polarized light','Non-polarized light ');
grid on