5

I know this question already asked and actually well explained in those answers, just one thing that actually confuses be in other answers what if i want to generate random points on the surface of n-Sphere with radius r uniformly?

As according to one of the algorithm, generate n-dimensional vector $[x_1,x_2,..,x_n]$, where $x_i$ is random numbers using Normal Distribution N(0,1) and then use following formula to generate random point on the surface of n-Sphere

$$\frac{1}{\sqrt{x_1^2+x_2^2+... +x_n^2}}[x_1,x_2,...,x_n]$$

I presume that this will generate random points uniformly on the surface of unit n-Sphere, so what if we want generate random points on the surface n-Sphere with arbitrary radius r do we need to change the variance in Normal distribution or what?

Please forgive me if its a stupid question.

Regards Ahsan

1 Answers1

3

From a comment by Rahul:

Take the random vector on the unit $n$-sphere, $$\frac{1}{\sqrt{x_1^2+...+x_n^2}}[x_1,...,x_n]$$ and multiply it by $r$.