function [up,across] = transformNY(u,v,angleV);
%
%   [up,across] = transformNY(u,v,angleV);
%s
%Function to transform the coordinates from the New York Bight to 
%up valley and across valley based on some positive angleV between
%the valley and true north.
%
%Soupy Alexander, 4/8/02


%Convert u and v to angle and magnitude

[mag,theta] = UVtoSpDir(u,v);

%Magnitude remains constant.  Convert to new theta

theta2 = theta - angleV;

%Compensate if new angle has passed 0 degrees

over_ang = find(theta2 > 360);
if isempty(over_ang) == 0;
    theta2(over_ang) = theta2(over_ang)-360;
end


%Reconfigure to new coordinate system
up = mag.*sin(theta2*(pi/180));
across = mag.*cos(theta2*(pi/180));
