Re:Random Points on a Sphere
by reitzensteinm on Monday April 27, 2015 @02:34AM
(#9444650)
Why would you regenerate it if the length exceeds 1? Can't you just normalize the vector regardless of its length (excluding 0)?
[ Parent
| on HN ]
Re:Random Points on a Sphere
by dietrichepp on Monday April 27, 2015 @02:41AM
(#9444673)
That would lead to the distribution being non-uniform: there would be more points in the corners of the cube.
Re:Random Points on a Sphere
by reitzensteinm on Monday April 27, 2015 @03:28AM
(#9444816)
Ah, of course. To visualize it, the distance between the center and the surface of the shape would be proportional to the probability of that vector being selected after normalization. Thanks!
Because that would bias the distribution to the corners of the cube.
Re:Random Points on a Sphere
by kasdkashdkas on Monday April 27, 2015 @02:48AM
(#9444698)
Since the box is anisotropic, this would not give the uniform distribution (it's more likely to draw a "diagonal" direction than a coordinate axis direction).