3 ms·
Why would you regenerate it if the length exceeds 1? Can't you just normalize the vector regardless of its length (excluding 0)?
by reitzensteinm 12y ago
Why would you regenerate it if the length exceeds 1? Can't you just normalize the vector regardless of its length (excluding 0)?
- dietrichepp 12y agoThat would lead to the distribution being non-uniform: there would be more points in the corners of the cube.
- reitzensteinm 12y agoAh, 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!
- gliptic 12y agoBecause that would bias the distribution to the corners of the cube.
- kasdkashdkas 12y agoSince 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).