An instrument used in X-ray crystallography to automatically determine the shape and symmetry of the unit cell of a crystal. The crystal is placed in the goniometer head with an arbitrary orientation. If the dimensions of the unit cell have been determined, they can be used to calculate the settings of the four angles of the diffractometer needed to observe a specific (h k l) reflection, where (h k l) are Miller indices. A computer controls the settings so that each (h k l) is examined in turn and the diffraction intensity measured. This information enables the electron density to be calculated, as the intensity of the reflection for a set of (h k l) planes is proportional to the square of the modulus of a function called the structure factor F hkl of the set, which is related to the electron density.