new version including all the functions to compute the atom velocity at scattering