skxray.core.twotheta_to_q

skxray.core.twotheta_to_q(two_theta, wavelength)

Helper function to convert \(2\theta\) + \(\lambda\) to \(q\). The point of this function is to prevent fat-fingered typos.

By definition the relationship is:

..math

\sin\left(\frac{2\theta}{2}

ight) = frac{lambda q}{4 pi}

thus

..math

q = \frac{4 \pi \sin\left(\frac{2\theta}{2}

ight)}{lambda}

Parameters:

two_theta : array

An array of \(2\theta\) values

wavelength : float

Wavelength of the incoming x-rays

Returns:

q : array

An array of \(q\) values