function [theta,rho] = cart2compass(u,v)
%CART2COMPASS convert cartesian coordinates into
% speed and direction data (degN).
%    [THETA,RHO] = CART2COMPASS convert the vectors u and v
%      from a cartesian reference system into rho (e.g. speed) with
%      direction theta (degree North).
%

rho = (u.^2+v.^2).^(0.5);

theta = 180 + ((atan2(u,v))*(180/pi));