Skip to content

[Book 1, Chapter 9.1] Why reject vectors outside unit sphere? #1369

Answered by hollasch
dimitry-ishenko asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, @rupsis is correct. All random points along the axes will lie inside the sphere. However, the cube diagonals will have not only that number of random points, but additional random points that were generated from the sphere to the unit corner — (√2)-1 more points, to be precise.

As a result, you get an image that looks like this:

See Generating random directions with uniform distribution
for a good article that covers this.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hollasch
Comment options

Answer selected by dimitry-ishenko
@dimitry-ishenko
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants