# Random point within a space at a distance of r

I have n dimensional space. Let us say n=20 for your case. And I also have a point p1 in that space.

What I want to do is get a random point (newpoint) in that space such that distance(p1, newpoint)<=r, where r represents radius that I already know.

Thank you. Any feedback will be greatly appreciated.

-
Assuming you want a uniform distribution within the ball of radius $r$, Nate Eldredge's answer here for the 3D case generalizes nicely to $n$ dimensions. Also, MathWorld has a page on ball point picking that gives a rather striking alternative approach. –  Rahul Oct 25 '12 at 9:52
Thank you! It is not as bad as I thought it would be! –  nth Oct 25 '12 at 10:04