Commit 87735c8
Fix sphere vertex sampling: compare squared radius to squared bound
In-sphere rejection sampling compared x*x+y*y+z*z (a squared magnitude)
against the un-squared max_radius, so the accepted region had radius
sqrt(max_radius) instead of max_radius. Square the bound. The sampling
cube already spans [-max_radius, max_radius] per component, so rejection
sampling stays valid.
Fixes #109
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 48f83e5 commit 87735c8
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
0 commit comments