scippneutron.conversion.beamline.two_theta#
- scippneutron.conversion.beamline.two_theta(*, incident_beam, scattered_beam)#
Compute the scattering angle between scattered and transmitted beams.
See
scippneutron.conversions.beamline
for the definition of the angle.The result is equivalent to
\[\begin{split}b_1 &= \mathtt{incident\_beam} / |\mathtt{incident\_beam}| \\ b_2 &= \mathtt{scattered\_beam} / |\mathtt{scattered\_beam}| \\ 2\theta &= \mathsf{acos}(b_1 \cdot b_2)\end{split}\]but uses a numerically more stable implementation by W. Kahan (https://people.eecs.berkeley.edu/~wkahan/MathH110/Cross.pdf).
See also
scippneutron.conversions.beamline.straight_incident_beam
,scippneutron.conversions.beamline.straight_scattered_beam