function [ bool ] = CalcT( R,Q , tin, tout )
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
t=Q/R;


if ( R > 0 )   if (t<tin) bool=0; end;  tout=min(t,tout); end; 
if ( R < 0 )   if (t>tout) bool=0; end;  tin=max(t,tin); end;
if ( Q< 0 )  bool=0; end;

 bool=1 ;
end
 


