0001 function re=setTiltGirderAbout(r,mag_gr,coord,PSI)
0002
0003
0004
0005
0006
0007
0008 pos=[mag_gr{:}];
0009
0010 numelems = length(pos);
0011
0012 if (numelems ~= length(PSI))
0013 error('ELEMINDEX, D must have the same number of elements');
0014 end
0015
0016
0017 switch coord
0018 case 'x'
0019 for i = 1:length(pos)
0020
0021 r{pos(i)}.T1(2) = -PSI(i);
0022 r{pos(i)}.T2(2) = PSI(i);
0023 r{pos(i)}.T1(1) = -r{pos(i)}.Length/2*sin(PSI(i));
0024 r{pos(i)}.T2(1) = r{pos(i)}.Length/2*sin(PSI(i));
0025 r{pos(i)}.RotAboutX = PSI(i);
0026
0027
0028 end
0029 r=ThetaPhiGirder(r,mag_gr);
0030
0031 case 'y'
0032 for i = 1:length(pos)
0033
0034 r{pos(i)}.T1(4) = -PSI(i);
0035 r{pos(i)}.T2(4) = PSI(i);
0036 r{pos(i)}.T1(3) = -r{pos(i)}.Length/2*sin(PSI(i));
0037 r{pos(i)}.T2(3) = r{pos(i)}.Length/2*sin(PSI(i));
0038 r{pos(i)}.RotAboutY = PSI(i);
0039
0040
0041 end
0042 r=ThetaPhiGirder(r,mag_gr);
0043
0044 case 's'
0045 r= atsettiltdipole(r,pos,PSI);
0046 r= UniformGirderErrors(r,mag_gr);
0047 otherwise
0048 disp('tilt about x, y or s');
0049 end
0050
0051
0052
0053 re=r;