format long
theta = input( 'enter angle in oC ')
theta=(theta/180)*pi;
a=cos(theta);
b=sin(theta);
c=tan(theta/2);
cc=c*c;
c1=1+cc;
d=2*c/c1;    %   sine
e=(1-cc)/c1; % cosine
disp(sprintf('tan = %22.16f',c))
disp(sprintf('sin = %22.16f, by tan = %22.16f',b,d)) 
disp(sprintf('cos = %22.16f, by tan = %22.16f',a,e)) 