Calculate coordinate-specific distance matrices, only for nearest neighbors and store in an array
Useful links