You could simplify the displacement calculation a bit by either using manhattan distances instead of working with radii, or by generating random polar coordinates (radius and angle) instead of random cartesian coordinates.