Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions books/RayTracingTheRestOfYourLife.html
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@
For our purposes, if we have PDF $p()$ and cumulative distribution function $P()$, we can use this
"inverse function" with a random number to get what we want:

$$ f(d) = P^{-1} (\operatorname{random_double}()) $$
$$ f(d) = P^{-1} (\operatorname{random\_double}()) $$

For our PDF $p(r) = r/2$, and corresponding $P(r)$, we need to compute the inverse of $P(r)$. If we
have
Expand All @@ -1100,7 +1100,7 @@

Thus our random number generator with density $p(r)$ can be created with:

$$ f(d) = \sqrt{4\cdot\operatorname{random_double}()} $$
$$ f(d) = \sqrt{4 \cdot \operatorname{random\_double}()} $$

Note that this ranges from 0 to 2 as we hoped, and if we check our work, we replace
`random_double()` with $1/4$ to get 1, and also replace with $1/2$ to get $\sqrt{2}$, just as
Expand Down Expand Up @@ -2154,7 +2154,7 @@
cross product that $\mathbf{n} \times \mathbf{a}$ is perpendicular to both $\mathbf{n}$ and
$\mathbf{a}$:

$$ \mathbf{s} = \operatorname{unit_vector}(\mathbf{n} \times \mathbf{a}) $$
$$ \mathbf{s} = \operatorname{unit\_vector}(\mathbf{n} \times \mathbf{a}) $$

$$ \mathbf{t} = \mathbf{n} \times \mathbf{s} $$

Expand Down