  The Erd\H os unit distance conjecture in the plane says that the number of
pairs of points from a point set of size $n$ separated by a fixed (Euclidean)
distance is $\leq C_{\epsilon} n^{1+\epsilon}$ for any $\epsilon>0$. The best
known bound is $Cn^{\frac{4}{3}}$. We show that if the set under consideration
is well-distributed and the fixed distance is much smaller than the diameter of
the set, then the exponent $\frac{4}{3}$ is significantly improved.
Corresponding results are also established in higher dimensions. The results
are obtained by solving the corresponding continuous problem and using a
continuous-to-discrete conversion mechanism. The degree of sharpness of results
is tested using the known results on the distribution of lattice points dilates
of convex domains.
  We also introduce the following variant of the Erd\H os unit distance
problem: how many pairs of points from a set of size $n$ are separated by an
integer distance? We obtain some results in this direction and formulate a
conjecture.
