function [vr2]=calcul_vr(inc_iwrap_t, az_N, u,v, vws, VG, VGz,trackp)
%hwd is the real wind direction (westerly, easterly sense) 

% [u,v]=wind_decomposition(hwd);
% u=hws.*u;
% v=hws.*v;
[li,col]=size(u);
inc_t=180-inc_iwrap_t;
inc_t=deg2rad(inc_t);
%vr1=hws*cos(deg2rad((az_N-hwd)))*sin(inc_t)+vws*cos(inc_t)-VG*cos(deg2rad(az_N-trackp))*sin(inc_t)-VGz*cos(inc_t)
for azi=1:col
    for rg=1:li
        vr2(rg,azi)=sin(inc_t(rg,azi)).*(u(rg,azi).*sin(deg2rad(az_N(rg,azi)))+v(rg,azi).*cos(deg2rad(az_N(rg,azi)))-VG(rg,azi).*cos(deg2rad(az_N(rg,azi)-trackp(rg,azi))))+(vws(rg,azi)-VGz(rg,azi)).*cos(inc_t(rg,azi));
    end
end
% noise=randn(li,col);
% noise=(noise-mean(noise))./std(noise);
% vr2=noise+vr2;