% Generates Figure 10.6 (left)

close all; clear all; warning off
p=[linspace(0,0.01,1000) linspace(0.01,0.99,1000) linspace(0.99,1,1000)];
ar = 0*p;
for j=1:length(p)
    ar(j) = cot_formula(p(j));
end

ar(end)=pi/2;

plot(p,ar,'k-','LineWidth',2)
set(gca,'FontSize',18,'FontWeight','normal','FontName','Times','Box','on');
axis([-0.008 1.008 -0.02 pi/2+0.02])
hold on

set(gca,'XTickMode','manual','XTick',[0 0.5 1],...
    'XTickLabel',{'0','1/2','1'},...
    'YTickMode','manual','YTick',[0 pi/4 pi/2],...
    'YTickLabel',{'0','     ','     '});
xlabel('Probability{} {\itp}','FontWeight','normal','FontSize',24);
ylabel('arccot(\rho)','FontWeight','normal','FontSize',24);
text(sqrt(3),0.5e-8,'\surd3','FontWeight','normal','FontSize',18,...
         'HorizontalAlignment','center','FontName','Times')
text(-0.015,pi/2,'\pi/2','FontWeight','normal','FontSize',18,...
         'HorizontalAlignment','right','FontName','Times')
text(-0.015,pi/4,'\pi/4','FontWeight','normal','FontSize',18,...
         'HorizontalAlignment','right','FontName','Times')
grid on;
% print -deps2c arccot.eps