function [u_new,v_new] = rotate_winds (u,v,angle) % Transforms u and v to a new frame of reference. % Inputs: u - eastward component of wind speed % v - northward component of wind speed % angle - angle to rotate by in degrees (positive=clockwise, % negative = anticlockwise) % Outputs: u_new - new u vector % v_new - new v vector % % CEB Jan 2012 u_new = u.*cosd(angle) - v.*sind(angle); v_new = u.*sind(angle) + v.*cosd(angle);