function  cylinder1(n)
r=input('Please enter the radius(greater than 5):');
h=input('Please enter the height of the cylinder:');
% to get x, y, and z of a point
% assuming the hole has a radius and height of 5


% drawing a cylinder
% Sample values
ri = 5;
% Create constant vectors
tht = linspace(0,2*pi,100);
z = linspace(0,h,20);

% Create inner cylinder
xi = repmat(ri*cos(tht),20,1);
yi = repmat(ri*sin(tht),20,1);
zi = repmat(z',1,100);

% Create outer cylinder
xa = repmat(r*cos(tht),20,1);
ya = repmat(r*sin(tht),20,1);
za = zi;

% Plot
% surf(xi,yi,zi)
% hold on
% surf(xa,ya,za)

%Now, if you want to close the ends:

x = [xi; flipud(xa); xi(1,:)];
y = [yi; flipud(ya); yi(1,:)];
z = [zi; flipud(za); zi(1,:)];
testsubject = mesh(x,y,z);
set(testsubject,'facecolor',[1 .4 .4],'FaceAlpha',0)

%getting random points

%for i=1:100
theta=2*pi*rand();
z1=(h-1)*rand();
% 	if z1>5
    	R=5+(r-5)*(rand())^.5;  %creates random uniform distribution. gets number between inner radius 5 and outer radius r
%  	else
%     	R=r*(rand())^.5;
% 	end
x1=R*cos(theta);
y1=R*sin(theta);

% Now to create a uniformly random trajectory

R1=2*r;
theta1=2*pi*(rand())^.5*((-1)^randi(2));;
Phi= 2*pi*(rand())^.5*((-1)^randi(2));;
x2= R1*sin(theta1)*cos(Phi);
y2= R1*sin(theta1)*sin(Phi);
z2= R1*cos(theta1);
hold on;
plot3([x1,x2],[y1,y2],[z1,z2]);
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
grid on
axis ([ -10 10 -10 10])

end

