VMT_VelVectMagDir
PURPOSE 
Computes the magnitude and direction of velocity vectors given the east
SYNOPSIS 
function [xo,yo,mag,dir] = VMT_VelVectMagDir(xi,yi,Veast,Vnorth)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
This function is called by:
SOURCE CODE 
0001 function [xo,yo,mag,dir] = VMT_VelVectMagDir(xi,yi,Veast,Vnorth)
0002
0003
0004
0005
0006
0007
0008
0009
0010 mag = sqrt(Veast.^2 + Vnorth.^2);
0011
0012
0013 indx1 = find(Veast >= 0 & Vnorth >= 0);
0014 indx2 = find(Veast >= 0 & Vnorth <= 0);
0015 indx3 = find(Veast <= 0 & Vnorth <= 0);
0016 indx4 = find(Veast <= 0 & Vnorth >= 0);
0017
0018
0019 dir = zeros(size(Veast));
0020
0021 dir(indx1) = 90 - atand(abs(Vnorth(indx1)./Veast(indx1)));
0022 dir(indx2) = 180 - atand(abs(Veast(indx2)./Vnorth(indx2)));
0023 dir(indx3) = 270 - atand(abs(Vnorth(indx3)./Veast(indx3)));
0024 dir(indx4) = 360 - atand(abs(Veast(indx4)./Vnorth(indx4)));
0025
0026
0027
0028 xo = xi;
0029 yo = yi;
Generated on Thu 21-Aug-2014 10:40:31 by m2html © 2005