Home > RPSstuff > pvd.m

pvd

PURPOSE ^

PVD Progressive vector diagrams.

SYNOPSIS ^

function [x,y]=pvd(dt,u,v);

DESCRIPTION ^

PVD  Progressive vector diagrams.
     [X,Y]=PVD(DT,W) returns the "trajectory" [X,Y] for the input vector
           w, the complex velocity
     [X,Y]=PVD(DT,U,V) returns the "trajectory" [X,Y] for the input 
           velocity vectors U,V (East and North velocities).  

  If u,v are in cm/s, and dt is in seconds, x,y are returned in cm.
  Example: u,v are in cm/s, with 4 hour spacing.  To get x,y in km, use
           dt=4*3600/1.e5

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [x,y]=pvd(dt,u,v);
0002 %PVD  Progressive vector diagrams.
0003 %     [X,Y]=PVD(DT,W) returns the "trajectory" [X,Y] for the input vector
0004 %           w, the complex velocity
0005 %     [X,Y]=PVD(DT,U,V) returns the "trajectory" [X,Y] for the input
0006 %           velocity vectors U,V (East and North velocities).
0007 %
0008 %  If u,v are in cm/s, and dt is in seconds, x,y are returned in cm.
0009 %  Example: u,v are in cm/s, with 4 hour spacing.  To get x,y in km, use
0010 %           dt=4*3600/1.e5
0011 %
0012 
0013 if nargin==3, 
0014     w=u+i*v;
0015 elseif nargin==2,
0016         w=u;
0017 end
0018 ind=find(isnan(w));
0019 w(ind)=0;
0020 z=cumsum(w)*dt;
0021 if nargout==1,
0022  x=z;
0023 else,
0024  x=real(z);
0025  y=imag(z);
0026 end

Generated on Wed 30-Nov-2005 14:45:02 by m2html © 2003