Previous | Next --- Slide 16 of 52
Back to Lecture Thumbnails
yuanzhec

In sampler.cpp, UniformHemisphereSampler3D::get_sample() sets theta to acos(Xi1), where Xi1 is a uniform random number between 0 and 1. How is that different from this?

motoole2

@yuanzhec Actually, they are equivalent! But you're right.. get_sample() uses a slightly different implementation.

The x-coordinate in this slide is given by sqrt(1-(xi_1)^2) cos(2 pi xi_2), whereas it is sin(acos(xi_1)) cos(2 pi xi_2) in sampler.cpp. However, since sqrt(1-(xi_1)^2) = sin(acos(xi_1)), both formulations produce the same result.