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.
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Another way. Choose a random angle between 0 and 2PI. Then choose a random number between 0 and r. pt(x,y) =
Note that it isn't uniform.