A new algorithm for quantitative assessment of similarity between two atoms in molecules is presented. Both the atomic similarity index and its derivatives with respect to the three Euler angles that describe the mutual orientation of the atoms under comparison are computed efficiently by taking advantage of the recently developed analytical representations for atomic zero-flux surfaces. The use of such representations makes it possible to substantially enhance the accuracy of the computed similarity indices without increasing the cost of their evaluation. Numerical tests involving oxygen atoms in several carbonyl compounds demonstrate the ability of the new algorithm to discern small changes in atomic similarity that are brought about by second-neighbor effects. Comparisons among hydrogen atoms in the acrolein molecule reveal the usefulness of the similarity index in detection and quantification of the effects of steric interactions on atomic shapes.