function Venu=Beam2ENU(Vbeam,heading,pitch,roll,ornt); % function Venu=Beam2ENU(Vbeam,T,heading,pitch,roll,up) % % Beam2ENU transforms beam data to ENU coordinates. % This version assumes that the heading, pitch and roll are fixed. % % Vbeam is the 3D velocity in beam coordinates. Array can be in % rows or columns as long as the number of data points is >3. % % T is the transformation matrix for beam to xyz coordinates, % Examples % T = [6461 -3232 -3232; 0 -5596 5596; 1506 1506 1506]; % profiler % T = [2896 2896 0; -2896 2896 0; -2896 -2896 5792]; % std current meter % % heading, pitch and roll are all in degrees % ornt==0 if the instrument points up, ornt==1 if down % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Use of this program is described in: % % Sullivan, C.M., Warner, J.C., Martini, M.A., Voulgaris, G., % Work, P.A., Haas, K.A., and Hanes, D.H. (2006) % South Carolina Coastal Erosion Study Data Report for Observations % October 2003 - April 2004., USGS Open-File Report 2005-1429. % % Program written in Matlab v7.1.0 SP3 % Program ran on PC with Windows XP Professional OS. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % T =[6461 -3232 -3232 ;... 0 -5596 5596 ;.... 1506 1506 1506]; % T = T/4096; % Scale the transformation matrix correctly to floating point numbers % if ornt == 1, T(2,:) = -T(2,:); T(3,:) = -T(3,:); end % % Put data in columns for the calculation [nr,nc] = size( Vbeam ); % find size of x car=1; if(nr