function r=root2(tleft,tright,dt,degree)
% function r=root2(tleft,tright,dt,degree)  finds root of sin(t)=0
%A function that finds a root of sin(t)=0
%  between tleft and tright.  dt gives the spacing.
% The polnomial degree is specified by degree.
% Example: root2(4,7,.01,4)
t=tleft:dt:tright;
c=polyfit(t,sin(t),degree);
rv=roots(c);
for i=1:degree
   if imag(rv(i))==0
      if((rv(i)>tleft)&(rv(i)<tright))
          r=rv(i);
	  return
       end
   end
end
