# RandomPointIn isn't uniform with area

ethicalnerd shared this problem 2 years ago
Solved

Using RandomPointIn("the unit circle") clusters the points near the center of the circle. To get uniform points, I have to generate pairs of r = sqrt(random()) and theta = 2*pi*random().

1

It doesn't seem so bad to me in my test file. :)

1

If you want, you can play with this command, too https://wiki.geogebra.org/e...

1

not for me

I think the points are generated r = random() and theta = 2*pi*random() instead r = sqrt(random()) and theta = 2*pi*random()

1

I've made a couple of trials again, using CAS and more digits, too.And confirm clustering in (0,0) - I stopped too early in my first attempt :(

This maybe explains the whole thing: http://mathworld.wolfram.co...

Then the command itself, meant for "general purpose" on different kind of regions, fails in this case - and probably others, depending on the properties of the region.

1

Thanks, we'll see if we can improve that at some point

1

y creo que hay un bug

los puntos aleatorios en una elipse están situados sobre una elipse girada con ejes vertical y horizontal y con mayor densidad de puntos cerca de los ejes

1

Sorry for the delay - this will be fixed very soon (probably for v600)