a=load('input_inlab_task_A1.txt');# takes input from text file and stores the numbers in an array
nx=a(1);#assign nx the first element of a
ny=a(2);#assign ny second element of a
g=@(r)(nx*cos(r)+ny*sin(r))*sin(r/3)-sin(r);# define g as function of r 
x0=[0 + 1e-5 pi/2];#range in which r should lie, 0 is a trivial solution irrespective of value of nx and ny
r=fzero(g,x0);#computes zero of function g in range x0 and assign it to r
fileID = fopen('output_inlab_task_01.txt','w');#opens the file in which output is to be loaded
fprintf(fileID,'%4.5f\n',r);#writing the ouput in output file
fclose(fileID);#closing the output file