Title: Fix rand_in_circle uniformity. · Issue #2425 · pythonarcade/arcade · GitHub
Open Graph Title: Fix rand_in_circle uniformity. · Issue #2425 · pythonarcade/arcade
X Title: Fix rand_in_circle uniformity. · Issue #2425 · pythonarcade/arcade
Description: Enhancement request: The rand_in_circle function defined in math.py makes more points near the circles's center. What should be added/changed? Modify the code code calculating radius r: # random radius r = radius * random.random() to thi...
Open Graph Description: Enhancement request: The rand_in_circle function defined in math.py makes more points near the circles's center. What should be added/changed? Modify the code code calculating radius r: # random ra...
X Description: Enhancement request: The rand_in_circle function defined in math.py makes more points near the circles's center. What should be added/changed? Modify the code code calculating radius r: # rando...
Opengraph URL: https://github.com/pythonarcade/arcade/issues/2425
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix rand_in_circle uniformity.","articleBody":"## Enhancement request:\r\nThe rand_in_circle function defined in math.py makes more points near the circles's center.\r\n\r\n### What should be added/changed?\r\nModify the code code calculating radius r:\r\n```python\r\n# random radius\r\nr = radius * random.random()\r\n```\r\n\r\nto this:\r\n```python\r\n# random radius\r\nr = radius * math.sqrt(random.random())\r\n```\r\n\r\nThe square root of a random number ensures the correct density ( based on https://stackoverflow.com/a/50746409 ).\r\n\r\n\r\n### What would it help with?\r\nThis change would improve the distribution of points for games that rely on this function, such as when spawning entities within a circle. A more uniform spread can enhance gameplay balance by avoiding the clustering of entities near the center.","author":{"url":"https://github.com/Rapen765","@type":"Person","name":"Rapen765"},"datePublished":"2024-10-19T20:16:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2425/arcade/issues/2425"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3cedadc6-ec88-40b9-c5d2-3bb135a856fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D476:994E3:68E064:8D4EA8:6969B7DE |
| html-safe-nonce | a96f6bd20f70b02d0479458c8f4a014fb96ceba6db58f227478dc3b158a3e686 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDc2Ojk5NEUzOjY4RTA2NDo4RDRFQTg6Njk2OUI3REUiLCJ2aXNpdG9yX2lkIjoiMzI2NjI2NDUxMDg3OTA4NjU1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c35e0ef8b717b135351ee5877c57aae1bc895f15dbdd96bc02543d739cfc886c |
| hovercard-subject-tag | issue:2599561341 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonarcade/arcade/2425/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee699b3642713fa6a0ca1a4a255353e6110e0e7a3eb78343d2d5be8e2025aa5b/pythonarcade/arcade/issues/2425 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee699b3642713fa6a0ca1a4a255353e6110e0e7a3eb78343d2d5be8e2025aa5b/pythonarcade/arcade/issues/2425 |
| og:image:alt | Enhancement request: The rand_in_circle function defined in math.py makes more points near the circles's center. What should be added/changed? Modify the code code calculating radius r: # random ra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Rapen765 |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonarcade/arcade git https://github.com/pythonarcade/arcade.git |
| octolytics-dimension-user_id | 39569439 |
| octolytics-dimension-user_login | pythonarcade |
| octolytics-dimension-repository_id | 49003082 |
| octolytics-dimension-repository_nwo | pythonarcade/arcade |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49003082 |
| octolytics-dimension-repository_network_root_nwo | pythonarcade/arcade |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width