# How to generate random points on a sphere?

• How do I generate $$1000$$ points $$\left(x, y, z\right)$$ and make sure they land on a sphere whose center is
$$\left(0, 0, 0\right)$$ and its diameter is $$20$$ ?.
• Simply, how do I manipulate a point’s coordinates so that the point lies on the sphere’s “surface” ?.

• a $z$-coordinate, which in your case should be chosen between $-10$ and $10$; and
• an angle in $[0,2\pi)$ corresponding to a longitude.
From those it’s straightforward to generate the $x$- and $y$-coordinates.