function res= eqn(theta)
	[N]=textread("input_outlab_task_A1.txt","%f");
	x1=N(1);
	y1=N(2);
	d=N(3);
	w=N(4);														#all these lines store
	n=N(5);														#the input values
	res=(y1-w)*tan(theta)+w*tan(get_alpha(theta,n))-x1;			#the equation needed to be solved for theta
																# the get_alpha function calculates the angle of refraction in the smoke screen
endfunction