function [M,LP]=RayMueller(Teta)
% Normalized to 4pi Rayleigh scattering matrix including depolarizetion
% by air. Molecules such as N2, O2 are diatomic and hence slightly
% anisotropic
% ro- anisotropic factor is defined as ratio of the perpendicular
%     and paraller scattered intensities at 90 deg. (Ir/Il) for Teta=90.
% ro=0.035 value from Liou Book
% however Hansen and Travis, 1974 sugest 0.031
ro=0.031;    
x=Teta;   % Teta - scattering angle in radians

term1=(1-ro)/(1+ro/2);
term2=(1+ro)/(1-ro);
term3=(1-2*ro)/(1-ro);
M=3/2*term1*[0.5*(term2+cos(x)^2), -0.5*sin(x)^2  ,0     ,0;...
                    -0.5*sin(x)^2,0.5*(1+cos(x)^2),0     ,0;...
                                0,0               ,cos(x),0;...
                                0,0               ,0     ,term3*cos(x)];

% linear polarization   
% maksimum for pi/2 only 0.94 instead 1 (without depolarization effect)
LP=sin(Teta)^2/(term2+cos(Teta)^2);


% scattering Meuller matrix without depolarization effect
%M=3/2*[0.5*(1+cos(x)^2),-0.5*sin(x)^2 ,   0        ,0;...
%       -0.5*sin(x)^2,    0.5*(1+cos(x)^2),0        ,0;...
%        0,               0,               cos(x),   0;...
%        0,               0,               0,        cos(x)];
      
