  Grazing Incidence X-ray Diffraction (GIXD) is a surface sensitive X-ray
investigation technique (or geometry configuration) that can reveal the
structural properties of a film deposited on a flat substrate. The term grazing
indicates that the angle between the incident beam and the film is small
(typically below 0.5 degrees). This essential technique has been employed on
liquid crystals, nanoparticles and colloids, nanostructures, corrosion
processes, polymers, bio-materials, interfaces, materials for solar cells,
photodiodes, and transistors, etc. Diffraction patterns in GIXD geometry are
typically captured with a 2D detector, which outputs images in pixel
coordinates. A step required to perform analyses such as grain size estimation,
disorder, preferred orientation, quantitative phase analysis of the probed film
surface, etc., consists in converting the diffraction image from pixel
coordinates to the momentum transfer or scattering vector in sample coordinates
(the reciprocal space mapping). This momentum transfer embeds information on
the crystal or polycrystal and its intrinsic rotation with respect to the
substrate. In this work we derive, in a rigorous way, the reciprocal space
mapping equations for a 3D+1S diffractometer in a way that is understandable to
anyone with basic notions of linear algebra, geometry, and X-ray diffraction.
