Closed
Description
Perhaps I'm just slow, but for Listing 16, the f()
function took me a little while to figure out.
double f(const vec3& d) {
auto cosine_squared = d.z()*d.z();
return cosine_squared;
}
If I understand correctly, random_unit_vector
)
and since d.z()*d.z()
.
The text doesn't make that obvious. Perhaps (and very likely) the issue is me. But if my understanding is correct, maybe some clarification could be useful. A small attempt on my part:
