function [A2] = transf(f1, l1, A1, f2, l2)
%
% TRANSF the airplane radar position recalculation
%        f, l = geographic radar positions in radians
%        A1 = [x;  y; z](P1) = position of airplane seen
%                              by radar at P1
%
M  = [   0       1        0         
         0       0        1         % M = almost permutations 
        -1       0        0    ];   % matrix 
%
R1 = [ cos(l1)   0      sin(l1)     
         0       1        0         % R1 = Displacement 
      -sin(l1)   0      cos(l1)];   %      1. rotation matrix
%
R2 = [  1        0        0     
        0      cos(f1)  sin(f1)     % R2 = Displacement 
        0     -sin(f1)  cos(f1)];   %      2. rotation matrix
%
P1c = gg2gc(f1, l1);                % 1. radar    geocentric
P2c = gg2gc(f2, l2);                % 2. radar   coordinates
%
DPc = P2c - P1c;                    % DPc - radar's displacement 
%                                     (1. radar pos. [f=0, l=0]) 
T = R2*R1*M*DPc;                    % - radar's displacement 
%                                     (1. radar pos. [f1, l1]) 
a = A1 - T;                         % A. pos. after translation
%
Dl = l2 - l1;                       % longitude difference
%
R4 = [ cos(Dl)   0      sin(Dl)   
         0       1        0         % R4 = rotation matrix, 
      -sin(Dl)   0      cos(Dl)];   %      rot. around y by l2-l1
%
R5 = [   1       0        0     
         0     cos(f2)  sin(f2)     % R5 = rotation matrix, 
         0    -sin(f2)  cos(f2)];   %      rot.  around x by f2
% 
A2 = R5*R4*R2'*a;                   % A2 = [x; y; z](P2)  
%                                     position of airplane 
%                                     seen by radar at P2
% end of function

