raytracing.github.io icon indicating copy to clipboard operation
raytracing.github.io copied to clipboard

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

Open hrakaroo opened this issue 1 year ago • 1 comments

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".

hrakaroo avatar May 15 '24 05:05 hrakaroo

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

dimitry-ishenko avatar May 28 '24 22:05 dimitry-ishenko