We have derived a series of analytical formulas describing the motion of a nanotip elastically driven across a Gaussian potential well of depth ${U}_{1}$ and half width $\ensuremath{\sigma}$. The tip gets pinned if the impact parameter ${y}_{0}$ is below a well-defined threshold value. Together with ${U}_{1}$ and $\ensuremath{\sigma}$, this value determines the pinning force. The scenario is slightly modified by superimposing a periodic potential with amplitude ${U}_{0}$ in the background, provided that ${U}_{0}\ensuremath{\ll}{U}_{1}$. The formulas presented here can be applied to estimate the pinning energy and the linear extension of the perturbation created by a point defect such as an atomic vacancy on a crystal surface from atomic-scale friction force measurements performed by scanning probe microscopy.