-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check distribution of arcade.math.rand_* functions #2428
Comments
@Rapen765 Are you up for taking a look at this? |
Yes, I am currently checking the functions and I am sure that those are correct: |
The only problem is the function def rand_on_circle(center: Point2, radius: float) -> Point2:
the note is now incorrect because you would have to pass a sqrt(random()) and not random(). Also not in for float but for radius. |
While we wait for feedback from Dragon on the |
Enhancement request:
TL;DR: Check for more random call centering bias like that of #2425
What needs verification
In #2426, a call to
math.sqrt
to wrap the random call seems to fix an issue with center-clustering bias inrand_in_circle
. It seems reasonable to check for & fix any similar bias in:arcade.math.rand_on_circle
arcade.math.rand_in_rect
arcade.math.rand_on_line
arcade.math.rand_angle_360_deg
arcade.math.rand_angle_spread_deg
arcade.math.rand_spread_deg
arcade.math.rand_magnitude
Any upstream equivalents in the pyglet codebase?no use ofrandom()
seems to exist on dev branch outside testsWhat would it help with?
Evenness of randomized points.
Best approach?
I'm open to suggestions on this. These seem like hot code paths so I'm uncertain of OOP-y abstractions / indirection layers to customize which distribution function we're mapping into. Thoughts welcome.
The text was updated successfully, but these errors were encountered: