0001 function [xyBb_rf,xyBPb_rf,xyrb_rf,xycosb_rf,xyxb_rf,xyyb_rf,xyBxb_rf,xyByb_rf,xyBphib_rf] = mg_interp_jd(theta,Xx,Xy,XBx,XBy,XBphi,xythetab_rf,method);
0002
0003
0004
0005
0006
0007
0008 if nargin < 8
0009 method = 'linear';
0010 end
0011 nr = size(Xx,1);
0012 if size(xythetab_rf,1) == 1,
0013 xythetab_rf = repmat(xythetab_rf,[nr,1]);
0014 end
0015 for ir = 1:nr
0016 xyxb_rf(ir,:) = interp1(theta,Xx(ir,:),xythetab_rf(ir,:),method);
0017 xyyb_rf(ir,:) = interp1(theta,Xy(ir,:),xythetab_rf(ir,:),method);
0018
0019 xyBxb_rf(ir,:) = interp1(theta,XBx(ir,:),xythetab_rf(ir,:),method);
0020 xyByb_rf(ir,:) = interp1(theta,XBy(ir,:),xythetab_rf(ir,:),method);
0021 xyBphib_rf(ir,:) = interp1(theta,XBphi(ir,:),xythetab_rf(ir,:),method);
0022 end
0023 xyrb_rf = sqrt(xyxb_rf.^2 + xyyb_rf.^2);
0024 xyBPb_rf = sqrt(xyBxb_rf.^2 + xyByb_rf.^2);
0025 xyBb_rf = sqrt(xyBPb_rf.^2 + xyBphib_rf.^2);
0026 xycosb_rf = abs(xyBxb_rf.*xyyb_rf - xyByb_rf.*xyxb_rf)./xyrb_rf./xyBPb_rf;