Distance sqrt x_distx_disty_disty_dist. The distance between them will appear just above the map in both miles and kilometers. First in your loop you call distance twice in a row with the same argument.
The output table can be quite large.
Lets see how it looks. Colours correspond to distances from point 3 the location we gave a value of 2 to in the raster. Declaring a new variable tmp and changing above code to tmp 1 distance. This will be slow for larger rasters or very high res.