Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't believe -1 to 1 represents a "unit cube" #1555

Open
hrakaroo opened this issue May 15, 2024 · 1 comment
Open

I don't believe -1 to 1 represents a "unit cube" #1555

hrakaroo opened this issue May 15, 2024 · 1 comment
Assignees
Milestone

Comments

@hrakaroo
Copy link

hrakaroo commented May 15, 2024

In the RayTracingInOneWeekend book around line 2314 in the dev branch the text reads:

First, we will use a rejection method to generate the random vector inside of the unit sphere. Pick
a random point in the unit cube, where $x$, $y$, and $z$ all range from -1 to +1, and reject this
point if it is outside the unit sphere.

While a unit sphere is defined as all points within one unit from a point in space, and therefore goes from -1 to 1, I don't believe it is correct that $x$, $y$, and $z$ all range from -1 to +1 represents a unit cube as each side would have a length of 2 units. I believe this is just a "cube" and not a "unit cube".

@hollasch hollasch self-assigned this May 15, 2024
@hollasch hollasch added this to the v4.0.0 milestone May 15, 2024
@dimitry-ishenko
Copy link

@hrakaroo is correct: https://en.wikipedia.org/wiki/Unit_cube. The fix is pretty trivial - drop the word unit from unit cube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants