%

function [lat,lon]=uv2path(x,y,u,v,tinc)

%

% function [lat,lon]=uv2path(x,y,u,v,tinc)

%

%        X,Y = STARTING (or ending) LON & LAT

%        U,V = VELOCITIES

%        TINC= TIME INTERVAL (negative=past; pos've=future)

%

% GENERATES THE PATH A PARTICLE WOULD 

% FOLLOW GIVEN A SET OF VELOCITIES & TIME

%

% Conversion factors:

% 

cms2kmhr=(1/100000)*3600;

km2lat=1.815/60;

km2lon=1.815*1.3/60;

lat(1)=y;

lon(1)=x;

%

for it=2:length(u);

lat(it)= y + ((v(it)+v(it-1))/2) * cms2kmhr*km2lat*tinc;

lon(it)= x + ((u(it)+u(it-1))/2) * cms2kmhr*km2lon*tinc;

x=lon(it);

y=lat(it);

end;