Talk:Geometry:TSAXS 3D

Compute ${\displaystyle q_{y}}$

{\displaystyle {\begin{alignedat}{2}\mathbf {q} &={\begin{bmatrix}q_{x}\\q_{y}\\q_{z}\end{bmatrix}}\\&=k{\begin{bmatrix}\sin \theta _{f}\cos \alpha _{f}\\\cos \theta _{f}\cos \alpha _{f}-1\\\sin \alpha _{f}\end{bmatrix}}\end{alignedat}}}

So:

{\displaystyle {\begin{alignedat}{2}\alpha _{f}&=\sin ^{-1}\left[{\frac {q_{z}}{k}}\right]\\{\frac {q_{x}}{k}}&=\sin \theta _{f}\cos \alpha _{f}\\\theta _{f}&=\sin ^{-1}\left[{\frac {q_{x}}{k}}{\frac {1}{\cos \alpha _{f}}}\right]\\{\frac {q_{y}}{k}}&=\cos \theta _{f}\cos \alpha _{f}-1\\q_{y}&=k\left(\cos \left(\sin ^{-1}\left[{\frac {q_{x}}{k}}{\frac {1}{\cos \alpha _{f}}}\right]\right)\cos \left(\sin ^{-1}\left[{\frac {q_{z}}{k}}\right]\right)-1\right)\\&=k\left({\sqrt {1-\left[{\frac {q_{x}}{k}}{\frac {1}{\cos \alpha _{f}}}\right]^{2}}}{\sqrt {1-\left[{\frac {q_{z}}{k}}\right]^{2}}}-1\right)\end{alignedat}}}

Or equivalently:

{\displaystyle {\begin{alignedat}{2}q_{y}&=k\left({\sqrt {1-\left[{\frac {q_{x}}{k}}{\frac {1}{\sqrt {1-[q_{z}/k]^{2}}}}\right]^{2}}}{\sqrt {1-\left[{\frac {q_{z}}{k}}\right]^{2}}}-1\right)\\&=k{\sqrt {1-{\frac {q_{x}^{2}}{k^{2}(1-q_{z}^{2}/k^{2})}}}}{\sqrt {1-{\frac {q_{z}^{2}}{k^{2}}}}}-k\end{alignedat}}}

Scratch/working (contains errors)

As a check of these results, consider:

{\displaystyle {\begin{alignedat}{2}q&={\sqrt {q_{x}^{2}+q_{y}^{2}+q_{z}^{2}}}\\&={\frac {2\pi }{\lambda }}{\sqrt {\sin ^{2}\theta _{f}\cos ^{2}\alpha _{f}+\left(\cos \theta _{f}\cos \alpha _{f}-1\right)^{2}+\sin ^{2}\alpha _{f}}}\\\left({\frac {q}{k}}\right)^{2}&=(\sin \theta _{f})^{2}(\cos \alpha _{f})^{2}+\left(\cos \theta _{f}\cos \alpha _{f}-1\right)^{2}+(\sin \alpha _{f})^{2}\\&=\left({\frac {x/d}{\sqrt {1+(x/d)^{2}}}}\right)^{2}\left(\cos \alpha _{f}\right)^{2}+\left(\cos \theta _{f}\cos \alpha _{f}-1\right)^{2}+\left({\frac {z\cos \theta _{f}/d}{\sqrt {1+(z\cos \theta _{f}/d)^{2}}}}\right)^{2}\\&=\left({\frac {x}{\sqrt {d^{2}+x^{2}}}}\right)^{2}\left(\cos \alpha _{f}\right)^{2}+\left(\cos \theta _{f}\cos \alpha _{f}-1\right)^{2}+\left({\frac {z\cos \theta _{f}}{\sqrt {d^{2}+z^{2}\cos ^{2}\theta _{f}}}}\right)^{2}\\&={\frac {x^{2}}{d^{2}+x^{2}}}\left(\cos \alpha _{f}\right)^{2}+\left(\cos \theta _{f}\cos \alpha _{f}-1\right)^{2}+{\frac {z^{2}\cos ^{2}\theta _{f}}{d^{2}+z^{2}\cos ^{2}\theta _{f}}}\\&={\frac {x^{2}}{d^{2}+x^{2}}}{\frac {d^{4}}{d^{2}+z^{2}\cos ^{2}\theta _{f}}}+\left(\cos \theta _{f}{\frac {d^{2}}{\sqrt {d^{2}+z^{2}\cos ^{2}\theta _{f}}}}-1\right)^{2}+{\frac {z^{2}\cos ^{2}\theta _{f}}{d^{2}+z^{2}\cos ^{2}\theta _{f}}}\end{alignedat}}}

Where we used:

{\displaystyle {\begin{alignedat}{2}\sin(\arctan[u])&={\frac {u}{\sqrt {1+u^{2}}}}\\\sin \theta _{f}&=\sin(\arctan[x/d])\\&={\frac {x/d}{\sqrt {1+(x/d)^{2}}}}\\&={\frac {x}{\sqrt {d^{2}+x^{2}}}}\end{alignedat}}}

And, we further note that:

{\displaystyle {\begin{alignedat}{2}\cos(\arctan[u])&={\frac {1}{\sqrt {1+u^{2}}}}\\\cos \theta _{f}&={\frac {1}{\sqrt {1+(x/d)^{2}}}}\\&={\frac {d^{2}}{\sqrt {d^{2}+x^{2}}}}\end{alignedat}}}

Continuing:

{\displaystyle {\begin{alignedat}{2}\left({\frac {q}{k}}\right)^{2}&={\frac {x^{2}}{d^{2}+x^{2}}}{\frac {d^{4}}{d^{2}+z^{2}\cos ^{2}\theta _{f}}}+\left({\frac {d^{2}}{\sqrt {d^{2}+x^{2}}}}{\frac {d^{2}}{\sqrt {d^{2}+z^{2}\cos ^{2}\theta _{f}}}}-1\right)^{2}+{\frac {z^{2}}{d^{2}+z^{2}\cos ^{2}\theta _{f}}}{\frac {d^{4}}{d^{2}+x^{2}}}\\&=d^{4}{\frac {x^{2}+z^{2}}{(d^{2}+x^{2})(d^{2}+z^{2}\cos ^{2}\theta _{f})}}+\left({\frac {d^{4}}{\sqrt {(d^{2}+x^{2})(d^{2}+z^{2}\cos ^{2}\theta _{f})}}}-1\right)^{2}\\&={\frac {d^{4}x^{2}+d^{4}z^{2}}{d^{4}+d^{2}x^{2}+d^{4}z^{2}}}+\left({\frac {d^{4}}{\sqrt {d^{4}+d^{2}x^{2}+d^{4}z^{2}}}}-1\right)^{2}\\&={\frac {d^{2}x^{2}+d^{2}z^{2}}{d^{2}+x^{2}+d^{2}z^{2}}}+\left({\frac {d^{8}}{d^{4}+d^{2}x^{2}+d^{4}z^{2}}}-2{\frac {d^{4}}{\sqrt {d^{4}+d^{2}x^{2}+d^{4}z^{2}}}}+1\right)\\&={\frac {d^{2}x^{2}+d^{2}z^{2}}{d^{2}+x^{2}+d^{2}z^{2}}}+{\frac {d^{6}}{d^{2}+x^{2}+d^{2}z^{2}}}-2{\frac {d^{3}}{\sqrt {d^{2}+x^{2}+d^{2}z^{2}}}}+1\\&={\frac {d^{2}x^{2}+d^{2}z^{2}+d^{6}-2d^{3}{\sqrt {d^{2}+x^{2}+d^{2}z^{2}}}+d^{2}+x^{2}+d^{2}z^{2}}{d^{2}+x^{2}+d^{2}z^{2}}}\\&={\frac {d^{6}+d^{2}+d^{2}x^{2}+x^{2}+2d^{2}z^{2}-2d^{3}{\sqrt {d^{2}+x^{2}+d^{2}z^{2}}}}{d^{2}+x^{2}+d^{2}z^{2}}}\\&=?\\&=?\\&={\frac {{\sqrt {d^{2}+x^{2}+z^{2}}}-d}{2{\sqrt {d^{2}+x^{2}+z^{2}}}}}\\&={\frac {1}{2}}\left(1-{\frac {d}{\sqrt {d^{2}+x^{2}+z^{2}}}}\right)\\q&={\frac {4\pi }{\lambda }}\sin \left(\theta _{s}\right)\end{alignedat}}}