Constrain Random Numbers to Inside a Circle I am generating two random numbers to choose a point in a circle randomly. The circles radius is 3000 with origin at the center. I'm using -3000 to 3000 as my bounds for the random numbers. I'm trying to get the coordinates to fall inside the circle (ie 3000, 3000 is not in the circle). What equation could I use to test the limits of the two numbers because I can generate a new one if it falls out of bounds.

Compare $x^2+y^2$ with $r^2$ and reject / retry if $x^2+y^2\ge r^2$.
