s=load("input_outlab_task_A1.txt");  %loading the input values
x1=s(1);   %assigning the loaded values
y1=s(2);
d=s(3);
w=s(4);
n=s(5);
f=@(x) w*(1-(cos(x)/sqrt((n*n)-(sin(x)*sin(x)))))+(x1*cot(x))-y1;   %function made after doing the calculation
l=fsolve(f,0.1);  %returns in radians
m=(l*180.0)/pi;  %changes to degrees
csvwrite("output_outlab_task_A1.txt",m); %output is printed in this file
