I am trying to plot random lines, starting from a specific radius of a sphere, but I only want the upper hemisphere, as shown in the image
So far I am able to create random starting points(but for R=15), random intersections, random slopes, but I don't know how to connect all these to plot the lines.
My code is
%Create the random starting points, slopes, intersections
tracks=input('Give me the number of muon tracks: ');
theta=180.*rand(tracks,1);
rho=15*ones(tracks,1);
startPoint = [theta rho];
[X,Y]=pol2cart(theta*pi/180,rho);
intersection =-6371+(2*6371).*rand(tracks,1);
slope = tand(360.*rand(tracks,1));
I know that I need only two elements to draw a line, but I kind of confused right now... Any idea on how to do it?