I have the following (relatively easy) problem. I am developing a ray tracer and I am following the tutorial explained in this link:

<http://www.scratchapixel.com/code.php?id=3&origin=/lessons/3d-basic-rendering/introduction-to-ray-tracing>

There is a formula I don't get though, which is used to map the pixel (i,j) to world coordinates. The formula is the following:

```
float fov = 30, aspectratio = width / height; 
float angle = tan(M_PI * 0.5 * fov / 180.);
float xx = (2 * ((x + 0.5) * invWidth) - 1) * angle * aspectratio; 
float yy = (1 - 2 * ((y + 0.5) * invHeight)) * angle;

```

In this tutorial the camera is placed at (0,0,0) and up/right/lookAt vector are not used at all. It seems that in every tutorial a different formula is used to map a pixel and I don't manage to get the reason.
Moreover, what about if my camera is not placed at (0,0,0) but in another position that I can decide? How would the formula vary? May you kindly help me? Thanks!