diff --git a/src/geomtools/sfx/lattice.py b/src/geomtools/sfx/lattice.py
index fdd9d63bbe37cf5138baa0e6dd3172c74fdadddc..92c8c26f75b3258d4879b5b946b63093b1a66383 100644
--- a/src/geomtools/sfx/lattice.py
+++ b/src/geomtools/sfx/lattice.py
@@ -2,6 +2,47 @@
 import numpy as np
 
 
+
+# Electron charge in C
+ELECTRON_CHARGE = 1.6021773e-19
+# Planck's constant (Js)
+PLANCK = 6.62606896e-34
+# Speed of light in vacuo (m/s)
+C_VACUO = 299792458
+
+
+def ph_en_to_lambda(a):
+    """Transforms photon energy (eV) to wavelength (m)"""
+    return PLANCK * C_VACUO / (a * ELECTRON_CHARGE)
+
+
+def get_q_from_xyz(x, y, z, lmd):
+    """Calculates q vector by detector coordinates"""
+    # r = sqrt(x*x + y*y)
+    # S = λ sqrt(z*z + x*x + y*y)
+    # cos φ = cos(arctan(y / x)) = x / r
+    # sin φ = sin(arctan(y / x)) = z / r
+    # sin 2θ / λ = sin(arctan(r / z)) = r / S
+    # cos 2θ / λ = cos(arctan(r / z)) = z / S
+    # q = sin 2θ / λ
+    # u = sin 2θ * cos φ / λ = x / S
+    # v = cos 2θ * sin φ / λ = y / S
+    # w = (cos 2θ - 1) / λ = z / S - 1 / λ
+    S = lmd * np.sqrt(x * x + y * y + z * z)
+    u = x / S
+    v = y / S
+    w = z / S - 1.0 / lmd
+    return np.array([u, v, w])
+
+
+def get_min_bragg_dist(r, clen, lmd, cell):
+    """Calculates minimal inter-bragg distance"""
+    # sin 2θ = sin(arctan(r / clen))
+    # q = sin 2θ / lmd
+    invq = lmd * np.sqrt(clen * clen + r * r) / r
+    return min(invq / a for a in cell)
+
+
 def spacing(h, k, l, a, b, c, alpha, beta, gamma):
     alpha *= np.pi / 180.
     beta *= np.pi / 180.