Return an array of evenly distributed points on a sphere give Radius and Origin. Given a sphere of radius $r$, and origin $x,y,z$ what is the simplest way I can generate an evenly distributed array of points on the sphere $(x_1,y_1,z_1),(x_2,y_2,z_2),\cdots(x_n,y_n,z_n)$.
Note I will be writing this as a function in Javascript, if it is any help.
EDIT
Essentially, I want to create a perfectly symmetrical shape with $X$ number of vertices that fits perfectly inside a sphere with radius $R$.
 A: Use a uniform random number generator to generate an angle $\theta\in[0,2\pi)$ (essentially a longitude) and a $z\in[-1,1]$; the surface area cut by the planes $z=a$ and $z=b$ depends only on $|a-b|$, provided that $a,b\in[-1,1]$, so you get a uniform distribution.
Once you have $\theta$ and $z$, the point is $\left\langle\sqrt{1-z^2}\cos\theta,\sqrt{1-z^2}\sin\theta,z\right\rangle$ in rectangular coordinates.
A: At the end of the Mathworld article it says you can generate three Gaussian random variables $x,y,z$.  Then $r=\sqrt {x^2+y^2+z^2}$ and $\frac xr, \frac yr, \frac zr$ are equally distributed on the unit sphere.
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
We have to generate random points in $\ds{\pars{\theta,\phi}}$ with
$\ds{0 \leq \theta < \pi}$ and $\ds{0 \leq \phi < 2\pi}$ in a spherical surface of radius $\ds{r}$ such that:
$$
\vec{r} = x\,\hat{x}  + y\,\hat{y} + z\,\hat{z}\,,\qquad
x = r\sin\pars{\theta}\cos\pars{\phi}\,,\quad
y = r\sin\pars{\theta}\sin\pars{\phi}\,,\quad z = r\cos\pars{\theta}
$$
It means we choose evenly distributed solid angles $\ds{\Omega}$ at the sphere surface.
Let's assume we have a generator of evenly distributed points $\ds{\braces{\xi}}$ in $\ds{\left[0, 1\right)}$. The probability distributions for $\ds{\theta}$ and $\ds{\phi}$ are given by $\ds{\half\,\sin\pars{\theta}}$ and $\ds{1 \over 2\pi}$,
respectively. With a couple of values of $\ds{\xi}$ ( let's say $\ds{\xi_{\theta}}$ and $\ds{\xi_{\phi}}$ ) we'll have:
$$
\int_{0}^{\theta}\half\sin\pars{t}\,\dd t=\xi_{\theta}\,,\qquad
\int_{0}^{\phi}{1 \over 2\pi}\,\dd t=\xi_{\phi}\qquad\imp\qquad
\left\lbrace\begin{array}{rcl}
\theta & = &2\arcsin\pars{\root{\xi_{\theta}}}
\\
\phi & = & 2\pi\xi_{\phi}
\end{array}\right.
$$

$$\large
\color{#c00000}{\mbox{Below, we show a}\ \color{#000}{{\tt javascript}}\ \mbox{code that makes the job:}}
$$
  \begin{align}
\end{align}


var TWOPI=2.0*Math.PI;

function randSphereSurface(r)// r: radius
{
 var phi=TWOPI*Math.random();
 var theta=2.0*Math.asin(Math.sqrt(Math.random()));
 var x=r*Math.sin(theta);
 var y=x*Math.sin(phi);
 x*= x*Math.cos(phi);
 var z=r*Math.cos(theta);

 return {"x":x,"y":y,"z":z};
}

Use as

var p=randSphereSurface(5.0); // sphere of radius 5.
document.write("The point is (", + p.x + "," + p.y + "," + p.z + ")");

