Quantifying local lattice distortions in alloys