# Geometry:WAXS 3D

In wide-angle scattering (WAXS), one cannot simply assume that the detector plane is orthogonal to the incident x-ray beam. Converting from detector pixel coordinates to 3D q-vector is not always trivial, and depends on the experimental geometry.

# Area Detector on Goniometer Arm

Consider a 2D (area) detector connected to a goniometer arm. The goniometer has a center of rotation at the center of the sample (i.e. the incident beam passes through this center, and scattered rays originate from this point also). Let $\phi _{g}$ be the in-plane angle of the goniometer arm (rotation about $z$ -axis), and $\theta _{g}$ be the elevation angle (rotation away from $xy$ plane and towards $z$ axis).

The final scattering vector depends on:

• $x$ : Pixel position on detector (horizontal).
• $z$ : Pixel position on detector (vertical).
• $d$ : Sample-detector distance.
• $\theta _{g}$ : Elevation angle of detector.
• $\phi _{g}$ : In-plane angle of detector.

Note that $x$ and $z$ are defined relative to the direct-beam. That is, for $\theta _{g}=0$ and $\phi _{g}=0$ , the direct beam is at position $(x,z)=(0,0)$ on the area detector.

## Central Point

The point $(x,z)=(0,0)$ can be thought of in terms of a vector that points from the source-of-scattering (center of goniometer rotation) to the detector:

$\mathbf {v} _{i}={\begin{bmatrix}0\\d\\0\end{bmatrix}}$ This vector is then rotated about the $x$ -axis by $\theta _{g}$ :

{\begin{alignedat}{2}\mathbf {v} _{2}&=R_{x}(\theta _{g})\mathbf {v} _{i}\\&={\begin{bmatrix}1&0&0\\0&\cos \theta _{g}&-\sin \theta _{g}\\0&\sin \theta _{g}&\cos \theta _{g}\\\end{bmatrix}}{\begin{bmatrix}0\\d\\0\end{bmatrix}}\\&={\begin{bmatrix}0\\d\cos \theta _{g}\\d\sin \theta _{g}\end{bmatrix}}\end{alignedat}} And then rotated about the $z$ -axis by $\phi _{g}$ :

{\begin{alignedat}{2}\mathbf {v} _{f}&=R_{z}(\phi _{g})\mathbf {v} _{2}\\&={\begin{bmatrix}\cos \phi _{g}&-\sin \phi _{g}&0\\\sin \phi _{g}&\cos \phi _{g}&0\\0&0&1\\\end{bmatrix}}{\begin{bmatrix}0\\d\cos \theta _{g}\\d\sin \theta _{g}\end{bmatrix}}\\&=d{\begin{bmatrix}-\sin \phi _{g}\cos \theta _{g}\\\cos \phi _{g}\cos \theta _{g}\\\sin \theta _{g}\end{bmatrix}}\end{alignedat}} ### Total scattering

The point $(x,z)=(0,0)$ on the detector probes the total scattering angle $\Theta =2\theta _{s}$ , which is simply the angle between $\mathbf {v} _{i}$ and $\mathbf {v} _{f}$ :

{\begin{alignedat}{2}\cos \Theta &={\frac {\mathbf {v} _{i}\cdot \mathbf {v} _{f}}{\left\|\mathbf {v} _{i}\right\|\left\|\mathbf {v} _{f}\right\|}}\\&=\cos \phi _{g}\cos \theta _{g}\\2\theta _{s}&=\arccos \left[\cos \phi _{g}\cos \theta _{g}\right]\end{alignedat}} Thus:

{\begin{alignedat}{2}q&={\frac {4\pi }{\lambda }}\sin \left(\theta _{s}\right)\\&=\pm {\frac {4\pi }{\lambda }}{\sqrt {\frac {1-\cos 2\theta _{s}}{2}}}\\&={\frac {4\pi }{\lambda }}{\sqrt {{\frac {1}{2}}\left(1-\cos \phi _{g}\cos \theta _{g}\right)}}\\&={\sqrt {2}}k{\sqrt {1-\cos \phi _{g}\cos \theta _{g}}}\end{alignedat}} ### Components

The momentum transfer vector is (for elastic scattering):

{\begin{alignedat}{2}\mathbf {q} &=\mathbf {k} _{f}-\mathbf {k} _{i}\\&={\frac {2\pi }{\lambda }}{\begin{bmatrix}-\sin \phi _{g}\cos \theta _{g}\\\cos \phi _{g}\cos \theta _{g}\\\sin \theta _{g}\end{bmatrix}}-{\frac {2\pi }{\lambda }}{\begin{bmatrix}0\\1\\0\end{bmatrix}}\\&={\frac {2\pi }{\lambda }}{\begin{bmatrix}-\sin \phi _{g}\cos \theta _{g}\\\cos \phi _{g}\cos \theta _{g}-1\\\sin \theta _{g}\end{bmatrix}}\end{alignedat}} This vector is of course the surface of the Ewald sphere.

## Arbitrary Point

For other points on the detector face, we can combine the above result with the known results for the Geometry of TSAXS. The incident beam is:

$\mathbf {v} _{i}={\begin{bmatrix}0\\d\\0\end{bmatrix}}$ $\mathbf {k} _{i}={\frac {2\pi }{\lambda }}{\begin{bmatrix}0\\1\\0\end{bmatrix}}$ $\mathbf {q} _{i}={\frac {2\pi }{\lambda }}{\begin{bmatrix}0\\0\\0\end{bmatrix}}$ For $\phi _{g}=0$ and $\theta _{g}=0$ , we can compute the vector onto the detector face:

$\mathbf {v} _{1}={\begin{bmatrix}x\\d\\z\end{bmatrix}}$ $\mathbf {k} _{1}={\frac {2\pi }{\lambda }}{\begin{bmatrix}{\frac {x}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\{\frac {d}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\{\frac {z}{\sqrt {x^{2}+d^{2}+z^{2}}}}\end{bmatrix}}$ $\mathbf {q} _{1}={\frac {2\pi }{\lambda }}{\begin{bmatrix}{\frac {x}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\{\frac {d}{\sqrt {x^{2}+d^{2}+z^{2}}}}-1\\{\frac {z}{\sqrt {x^{2}+d^{2}+z^{2}}}}\end{bmatrix}}$ This vector is then rotated about the $x$ -axis by $\theta _{g}$ :

{\begin{alignedat}{2}\mathbf {v} _{2}&=R_{x}(\theta _{g})\mathbf {v} _{1}\\&={\begin{bmatrix}1&0&0\\0&\cos \theta _{g}&-\sin \theta _{g}\\0&\sin \theta _{g}&\cos \theta _{g}\\\end{bmatrix}}{\begin{bmatrix}x\\d\\z\end{bmatrix}}\\&={\begin{bmatrix}x\\d\cos \theta _{g}-z\sin \theta _{g}\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}\end{alignedat}} $\mathbf {k} _{2}={\frac {2\pi }{\lambda }}{\frac {1}{\sqrt {x^{2}+d^{2}+z^{2}}}}{\begin{bmatrix}x\\d\cos \theta _{g}-z\sin \theta _{g}\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}$ $\mathbf {q} _{2}={\frac {2\pi }{\lambda }}{\begin{bmatrix}{\frac {x}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\{\frac {d\cos \theta _{g}-z\sin \theta _{g}}{\sqrt {x^{2}+d^{2}+z^{2}}}}-1\\{\frac {d\sin \theta _{g}+z\cos \theta _{g}}{\sqrt {x^{2}+d^{2}+z^{2}}}}\end{bmatrix}}$ The vector is then rotated about the $z$ -axis by $\phi _{g}$ :

{\begin{alignedat}{2}\mathbf {v} _{f}&=R_{z}(\phi _{g})\mathbf {v} _{2}\\&={\begin{bmatrix}\cos \phi _{g}&-\sin \phi _{g}&0\\\sin \phi _{g}&\cos \phi _{g}&0\\0&0&1\\\end{bmatrix}}{\begin{bmatrix}x\\d\cos \theta _{g}-z\sin \theta _{g}\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}\\&={\begin{bmatrix}x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}\end{alignedat}} $\mathbf {k} _{f}={\frac {2\pi }{\lambda }}{\frac {1}{\sqrt {x^{2}+d^{2}+z^{2}}}}{\begin{bmatrix}x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}$ $\mathbf {q} ={\frac {2\pi }{\lambda }}{\begin{bmatrix}{\frac {x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\{\frac {x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})}{\sqrt {x^{2}+d^{2}+z^{2}}}}-1\\{\frac {d\sin \theta _{g}+z\cos \theta _{g}}{\sqrt {x^{2}+d^{2}+z^{2}}}}\end{bmatrix}}$ ### Components

$\mathbf {q} ={\frac {2\pi }{\lambda }}{\frac {1}{d^{\prime }}}{\begin{bmatrix}x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})-d^{\prime }\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}$ Where:

$d^{\prime }={\sqrt {x^{2}+d^{2}+z^{2}}}$ ### Total magnitude

{\begin{alignedat}{2}\cos \Theta &={\frac {\mathbf {k} _{i}\cdot \mathbf {k} _{f}}{\left\|\mathbf {k} _{i}\right\|\left\|\mathbf {k} _{f}\right\|}}\\&={\begin{bmatrix}0\\1\\0\end{bmatrix}}\cdot {\frac {1}{\sqrt {x^{2}+d^{2}+z^{2}}}}{\begin{bmatrix}x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\d\sin \theta _{g}+z\cos \theta _{g}\end{bmatrix}}\\&={\frac {x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})}{\sqrt {x^{2}+d^{2}+z^{2}}}}\\\end{alignedat}} Thus:

{\begin{alignedat}{2}q&={\sqrt {2}}k{\sqrt {1-{\frac {x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})}{\sqrt {x^{2}+d^{2}+z^{2}}}}}}\end{alignedat}} #### Check

We define:

{\begin{alignedat}{2}d^{\prime }&={\sqrt {x^{2}+d^{2}+z^{2}}}=\|\mathbf {v} _{1}\|\\(v_{2y})&=(d\cos \theta _{g}-z\sin \theta _{g})\\(v_{2y})^{2}&=(d\cos \theta _{g}-z\sin \theta _{g})^{2}\\&=d^{2}\cos ^{2}\theta _{g}-2dz\cos \theta _{g}\sin \theta _{g}+z^{2}\sin ^{2}\theta _{g}\end{alignedat}} And calculate:

{\begin{alignedat}{2}q^{2}&=[(q_{x})^{2}+(q_{y})^{2}+(q_{z})^{2}]\\\left({\frac {q}{k}}\right)^{2}d^{\prime 2}&={\begin{alignedat}{2}[&\left(x\cos \phi _{g}-\sin \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\right)^{2}\\&+\left(x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})-d^{\prime }\right)^{2}\\&+\left(d\sin \theta _{g}+z\cos \theta _{g}\right)^{2}]\end{alignedat}}\\&={\begin{alignedat}{2}[&\left(x\cos \phi _{g}-\sin \phi _{g}(v_{2y})\right)^{2}\\&+\left(x\sin \phi _{g}+\cos \phi _{g}(v_{2y})-d^{\prime }\right)^{2}\\&+\left(d\sin \theta _{g}+z\cos \theta _{g}\right)^{2}]\end{alignedat}}\\&={\begin{alignedat}{2}[&x^{2}\cos ^{2}\phi _{g}-2x\cos \phi _{g}\sin \phi _{g}(v_{2y})+\sin ^{2}\phi _{g}(v_{2y})^{2}\\&+x^{2}\sin ^{2}\phi _{g}+x\sin \phi _{g}\cos \phi _{g}(v_{2y})-d^{\prime }x\sin \phi _{g}\\&+x\sin \phi _{g}\cos \phi _{g}(v_{2y})+\cos ^{2}\phi _{g}(v_{2y})^{2}-d^{\prime }\cos \phi _{g}(v_{2y})\\&-d^{\prime }x\sin \phi _{g}-d^{\prime }\cos \phi _{g}(v_{2y})+d^{\prime 2}\\&+d^{2}\sin ^{2}\theta _{g}+2dz\sin \theta _{g}\cos \theta _{g}+z^{2}\cos ^{2}\theta _{g}]\end{alignedat}}\\\end{alignedat}} Grouping and rearranging:

{\begin{alignedat}{2}\left({\frac {q}{k}}\right)^{2}d^{\prime 2}&={\begin{alignedat}{2}[&x^{2}+(v_{2y})^{2}\\&-2d^{\prime }x\sin \phi _{g}\\&-2d^{\prime }\cos \phi _{g}(v_{2y})\\&+d^{\prime 2}\\&+d^{2}\sin ^{2}\theta _{g}+2dz\sin \theta _{g}\cos \theta _{g}+z^{2}\cos ^{2}\theta _{g}]\end{alignedat}}\\&={\begin{alignedat}{2}[&d^{\prime 2}+x^{2}+(d^{2}\cos ^{2}\theta _{g}-2dz\cos \theta _{g}\sin \theta _{g}+z^{2}\sin ^{2}\theta _{g})\\&-2d^{\prime }x\sin \phi _{g}-2d^{\prime }\cos \phi _{g}(v_{2y})\\&+d^{2}\sin ^{2}\theta _{g}+2dz\sin \theta _{g}\cos \theta _{g}+z^{2}\cos ^{2}\theta _{g}]\end{alignedat}}\\&={\begin{alignedat}{2}[&d^{\prime 2}+x^{2}+d^{2}+z^{2}\\&-2d^{\prime }x\sin \phi _{g}-2d^{\prime }\cos \phi _{g}(v_{2y})]\end{alignedat}}\\&=2d^{\prime 2}-2d^{\prime }x\sin \phi _{g}-2d^{\prime }\cos \phi _{g}(v_{2y})\\&=2d^{\prime 2}-2d^{\prime }x\sin \phi _{g}-2d^{\prime }\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\\&=2d^{\prime }\left(d^{\prime }-x\sin \phi _{g}-\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})\right)\\\left({\frac {q}{k}}\right)^{2}&=2\left(1-{\frac {x\sin \phi _{g}+\cos \phi _{g}(d\cos \theta _{g}-z\sin \theta _{g})}{d^{\prime }}}\right)\end{alignedat}} # Area Detector on Goniometer Arm, with offsets

In the most general case, the sample may not sit at the exact center of the goniometer rotation. In such a case, corrections must be applied.

TBD