I am currently working through the "Physically Based Rendering" book (pbrt) and found a passage that I am not sure if it is correct.
In this section, they describe how to construct a local coordinate system from a single 3D unit vector $v$, computing two perpendicular unit vectors (u, w):
$$ u = (\frac{1-v_x^2}{1+v_z}, -\frac{v_x v_y}{1+v_z}, -v_x) \\ w = (-\frac{v_x v_y}{1+v_z}, \frac{1-v_y^2}{1+v_z}, -v_y) $$
I tried to derive it and could not get there. I also checked if the proposed vectors are in fact unit vectors (with $v = (\frac{1}{\sqrt3}, \frac{1}{\sqrt3} \frac{1}{\sqrt3})$) and found that they are not.
Do you have an intuition what is wrong here? Or if they are right, could you proof this or link me to a source that can? I could not find anything.
It seems to be a typo and should actually be:
$$ u = (1-\frac{v_x^2}{1+v_z}, -\frac{v_x v_y}{1+v_z}, -v_x) \\ w = (-\frac{v_x v_y}{1+v_z}, 1-\frac{v_y^2}{1+v_z}, -v_y) $$
These vectors are normalized and perpendicular to each other and $v$.