www.pudn.com > level_set_methods_1.1.zip > get_dt_vector.m, change:2005-05-05,size:351b


function [dt] = get_dt_vector(alpha,dx,dy,u,v) 
% 
% Calculate the Euler time step. 
% 
% Author: Baris Sumengen  sumengen@ece.ucsb.edu 
% http://vision.ece.ucsb.edu/~sumengen/ 
% 
 
if alpha <= 0 | alpha >= 1  
    error('alpha needs to be between 0 and 1!'); 
end 
 
maxs = max(abs(u(:))/dx + abs(v(:))/dy); 
dt = alpha/(maxs+(maxs==0));