The geometric difference in the relative arrangement of atoms in molecules with the same chemical formula significantly affects the properties of the crystal. For quantitative comparison of the spatial geometric structure of two molecules, we used the method of optimal superposition of molecules through the minimization of a certain comparison function by rotating the molecules after superposing their centers of mass. The search for the minimum of the comparison function over Euler rotation angles is performed by the Rosenbrock method. The assumed criterion for comparing molecules allows us to quantify the proximity in the spatial structure of molecules. The implementation of the method is shown by comparing the structure of eight molecules in four crystalline substances. © 2020 ASSA.