Rayleigh criterion

To resolve two lines in diffraction spectrum, the maximum of one line lies over the first minimum of the other.

For an $N$ slit grating to resolve $\lambda_1 < \lambda_2$ in the first-order spectrum, if angles are small, $$ \begin{align*} N = \frac{\lambda_1}{\lambda_2-\lambda_1}. \end{align*} $$ (Derivation)