<p><a href="https://i.sstatic.net/CGpwF.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CGpwF.jpg" alt="Simplified Map Equations"></a></p>

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

CC BY-SA 4.0
2019-12-23T04:48:51.793Z
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...
TheOrestes
CC BY-SA 4.0
2019-12-20T01:53:06.793Z
2019-12-20T01:53:06.793Z
dehinrsu
<p>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 &amp; implementing multi-threaded ray tracer, adding features like Intel's denoiser, assimp integration etc. </p>

<p>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. </p>

<p><a href="https://i.sstatic.net/lqjec.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lqjec.jpg" alt="enter image description here"></a></p>

<p>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 :(  </p>

<p>Regards. </p>

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

<raytracing><mathematics><sampling>
Mapping sample to a disk
TheOrestes
# Mapping sample to a disk

(Asked by: username_0 on 2019-12-19)

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](https://i.sstatic.net/lqjec.jpg)](https://i.sstatic.net/lqjec.jpg)

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 :(

Regards.

**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 :|

**Tags:** raytracing, mathematics, sampling

---

## 1 answers

### Answer by username_1 on 2019-12-20. Score: -1

[![Simplified Map Equations](https://i.sstatic.net/CGpwF.jpg)](https://i.sstatic.net/CGpwF.jpg)

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

> **Comments:**
> **username_0**: 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...  

---

