Skip to content

Commit fe3385b

Browse files
committed
Fix text around unit sphere random pt generation
Resolves #1603
1 parent 40c5c92 commit fe3385b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Change Log / Ray Tracing in One Weekend
1212
height for code listings in both print and browser.
1313

1414
### In One Weekend
15-
- Fix -- Fixed usage of the term "unit cube" for a cube of diameter two (#1555)
15+
- Fix -- Fixed usage of the term "unit cube" for a cube of diameter two (#1555, #1603)
1616
- Fix -- Fixed broken highlighting on some code listings (#1600)
1717

1818
### The Next Week

books/RayTracingInOneWeekend.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,9 +2302,10 @@
23022302
3. Invert the normalized vector if it falls onto the wrong hemisphere
23032303

23042304
<div class='together'>
2305-
First, we will use a rejection method to generate the random vector inside the unit sphere. Pick a
2306-
random point in the cube enclosing the unit sphere (that is, where $x$, $y$, and $z$ are all in the
2307-
range $[0,1]$), and reject this point if it is outside the unit sphere.
2305+
First, we will use a rejection method to generate the random vector inside the unit sphere (that is,
2306+
a sphere of radius 1). Pick a random point inside the cube enclosing the unit sphere (that is, where
2307+
$x$, $y$, and $z$ are all in the range $[-1,+1]$). If this point lies outside (or on) the unit
2308+
sphere, then generate a new one until we find one that lies inside the unit sphere.
23082309

23092310
![Figure [sphere-vec]: Two vectors were rejected before finding a good one
23102311
](../images/fig-1.11-sphere-vec.jpg)

0 commit comments

Comments
 (0)