So I have been reading this wonderful book on ray tracing by Kevin Suffern, Ray tracing from Ground Up. I am reading this book after finishing Peter Shirley's first two book on ray tracing & implementing multi-threaded ray tracer, adding features like Intel's denoiser, assimp integration etc.

What struck me was before I read the third book, it would be good idea to read more on sampling. Which is why am skimming through this current book. At this moment, am stuck on a topic which explains how sample point in unit square is mapped onto unit radius disk.

enter image description here

I am stuck at the part where book mentions how equations are mapped. Radius part is clear to me, however, am not very clear about the angle (phi) part. Is there any derivation as to how this was deduced? Or is it done to avoid atan() calculation and is a neat approximation of it? After putting in test values I have understood how values get converted, however, am very keen to understand how this formulas for Phi was deduced based on different quarters, unless it's very obvious and I have overlooked it :(


EDIT: After more digging, i have understood that if i assume first quadrant value, then second, third & fourth values can be deduced by rotating/adding (Pi/2) to angle phi & switching axis due to quadrant change. However, first quadrant value is still not clear :|


1 Answer 1


Simplified Map Equations

Check the last column in the table for the deciphered version of the existing Map Equations for easier comprehension.

  • $\begingroup$ Thanks for going all the way & editing the image to make it obvious :) However, this still doesn't clear from where (Pi/4) factor came in the first quarter... $\endgroup$
    – TheOrestes
    Dec 23, 2019 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.