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

Reword spherical coords in book 3, chap 4, para 3 #1625

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 9 additions & 6 deletions books/RayTracingTheRestOfYourLife.html
Original file line number Diff line number Diff line change
Expand Up @@ -1389,12 +1389,15 @@
space is called _the rejection method_, and is found all over the literature. The method covered
in the last chapter is referred to as _the inversion method_ because we invert a PDF.

Every direction in 3D space has an associated point on the unit sphere and can be generated by
solving for the vector that travels from the origin to that associated point. You can think of
choosing a random direction as choosing a random point in a constrained two dimensional plane: the
plane created by mapping the unit sphere to Cartesian coordinates. The same methodology as before
applies, but now we might have a PDF defined over two dimensions. Suppose we want to integrate this
function over the surface of the unit sphere:
Every direction in 3D space can be represented as a point on the unit sphere, where the vector from
the origin to the point indicates the direction. Standard spherical coordinates are $r$ (the
distance from the origin to the point), $\theta$ (the polar angle), and $\phi$ (the azimuthal
angle). Since we're only concerned with directions here, we can just ignore $r$. Thus, to choose a
random direction, we just need to choose random $\theta \in [0,\pi]$, and
$\phi \in [0, \frac{\pi}{2}]$.

So now we have a PDF defined over two dimensions: $\theta$ and $\phi$. Suppose we want to integrate
this function over the surface of the unit sphere:

$$ f(\theta, \phi) = \cos^2(\theta) $$

Expand Down