function [R,z] = gyrotronRadiusTD(theta,d) %[R,z] = gyrotronRadiusTD(theta,d) % Calculates the radius of multi-section cylindrical shell % and gives the corresponding axial z-values. % The inputs are 'Theta' (angle), and 'Distance' % hence the 'TD' in the function name. % % Inputs: (must be the same size) % 'd': [distance] the corresponding axial length % vector defining the length of each section. % 'theta': [radians] a vector of theta angles % that describe the increase in radius with increasing % axial distance. % % Outputs: % 'R': [distance] the radius vector at the axial % points given by the vector 'z'. % 'z': [distance] the axial distance vector. % % Example: % d = [2 1 1.5 1 1 1 1]; % theta = [1 2 0.7 -1 -2 -1 0]*pi/180; % [R,z] = gyrotronRadiusTD(theta,d); % plot(z,R,'b.',z,R,'g'); % % Last edit by Eunmi Choi and Colin Joye 7/15/03 R =[0 cumsum( d.*tan(theta) )]; z =[0 cumsum( d )]; % ------------ End gyrotronRadiusTD.m -------------