function radi=radial(ws_mean,wd_mean,origin);
radi=NaN*ones(size(ws_mean));
%orig=333.3;%azimuth with respect of true north of the tower
beta=abs(wd_mean-origin);
u_toward=find(beta < 90  | beta >= 270);
u_away=find(beta >= 90  & beta <270);
beta(u_away)=abs(beta(u_away)-180);
radi(u_toward)=-ws_mean(u_toward).*cos(deg2rad(beta(u_toward))); %toward the radar (tower to radar) see dissertation chapter 7
radi(u_away)=ws_mean(u_away).*cos(deg2rad(beta(u_away)));
% radi=ws_mean.*cos(deg2rad(beta);