function NaClPeakIntensity2
h=2; k=2; l=2;
Lambda = 1.54056;
a = 5.64;
if (h == k & k == l) 
    M = 8;
end
if (k == 0 || l == 0) 
    M = 12; 
end
if (k == 0 && l == 0) 
    M = 6; 
end
nfNa = 1 + real(exp(-i*pi*(h+k))) + real(exp(-i*pi*(h+l))) + real(exp(-i*pi*(k+l)));
nfCl = real(exp(-i*pi*(h+k+l))) + real(exp(-i*pi*h)) + real(exp(-i*pi*k)) + real(exp(-i*pi*l));
fprintf(1,'\nfactor1=%.2f\n', 1.0/sqrt(h^2+k^2+l^2));
d = a/sqrt(h^2+k^2+l^2); fprintf(1,'d=%.2f\n', d);
Theta = asin(Lambda/(2*d));
fprintf(1,'sin(T)=%.2f\n', Lambda/(2*d));
fprintf(1,'cos(T)=%.2f\n', cos(Theta));
fprintf(1,'2T=%.2f\n', 360.0*Theta/pi);
fprintf(1,'factor=%.2f\n',sin(Theta)/Lambda);
fNa = 11*sin(Theta)/Lambda;fCl = 17*sin(Theta)/Lambda;
fprintf(1,'fNa=%.2f\n',fNa);fprintf(1,'fCl=%.2f\n',fCl);
S = nfNa*fNa + nfCl*fCl;fprintf(1,'S=%.2f\n',S);
LP = (1.0  + (cos(2*Theta))^2)/(8*cos(Theta)*(sin(Theta))^2);
fprintf(1,'LP=%.2f\n',LP);fprintf(1,'M=%.2f\n',M);fprintf(1,'I=%.2f\n',S*S*M*LP);
