I want to generate an array of coordinates, (x,y,z), such that they:
$\bf{1)}$ All lie on the surface of a sphere, centered on the origin.
$\bf2)$ Follow the density function $1+sin(\theta)^2$, where $\theta$ is measured from the z-axis. (i.e that the number of points per unit area, on the sphere's surface, is proportional to $1+sin(\theta)^2$.
$\bf{If}$ the input values of $\theta$ are selected uniformly over the interval $(0, \pi)$ (and a point placed at each of these theta value) then I am aware that, because of the way that the solid angle ($d\Omega$) varies over the surface of the sphere, the density of points will naturally vary as $\frac{1}{\sin(\theta)}$.
On this page http://mathworld.wolfram.com/SpherePointPicking.html it is shown how an even distribution of points on the sphere can be reached by playing with the input values of $\theta$ (specifically if $\theta = \arccos(2v-1)$ where $v$ is uniformly distributed over the interval (0,1).
My question is how do I find the relationship between the required input values, $\theta$, and the uniform variable $v$ for an $\bf{arbitrary}$ density distribution, in this case $1+sin(\theta)^2$ ??
I assume that the density should be uniform wrt the other angle. And that the density $1+sin(\theta)^2$ lacks the normalization factor.
Suppose we generate the points in this way: First generate ($t,z$) where $z$ follows some density $f_z(z)$ in $[-1,1]$ and $t$ is uniform in $[0,2 \pi]$. The interpret this a a cilynder and project it onto the sphere:
$$(x,y,z) = ( \sqrt{1-z^2}\cos t,\sqrt{1-z^2}\sin t,z)$$
Now, the relation between $z = \cos \theta $ and $\theta$ is:
$$ f_z(z)=\frac{f_\theta(\theta)}{|\sin(\theta))|}\bigg\rvert_{\theta = \operatorname{acos} (z)}=\alpha \frac{2-z^2}{\sqrt{1-z^2}}=\frac{2}{3\pi} \frac{2-z^2}{\sqrt{1-z^2}}$$
and
$$F_z(z)=\frac{6\operatorname{asin}(z)+2z\,\sqrt{1-{{z}^{2}}}+3{\pi} }{6{\pi} }$$
Sadly, the inverse of this cumulative distribution cannot be expressed in closed form, so the usual random generation procedure cannot be used directly...