I have a line going off the origin in a direction defined by angles $(\phi,\theta)$, the latter being the azimuthal angle. Around this line, I have a cone, which "heads off" in the same direction as the line, and has a certain opening angle $\alpha$ . The cone is cut up into a certain number of spherical sector layers of constant thickness, and an arbitrary density function describes how many points should be generated in each of these sectors.
Sorry for the long setup. Now, I have a difference of two spherical sectors, which is pointed in a direction $(\phi,\theta)$, whose smaller end is facing the origin, and whose edges form an angle $\alpha$. I want to generate $N$ points uniformly within it.
I first tried the naïve, wrong method, which was uniformly distributing all their coordinates, as in $\phi-\alpha/2<\phi_{point}<\phi+\alpha/2$, repeating the same for $\theta$, and keeping the distance from the origin between the top and bottom ends of the frustrum.