I'm looking for a code that takes these inputs: (i) 2D lattice in x,y coordinates (ii) coordinate of interest (iii) integer n, and outputs the coordinates of the n-th nearest neighbours.
For example:
- Input (i) some arbitrary lattice (ii) (0,0) as coordinate of interest (iii) 2 – for next nearest neighbours.
- Output (-1,0), (0,1), (1,0), (0,-1) for nearest neighbours, (-1,1), (1,1), (1,-1), (-1,-1) for next nearest neighbours.
If there is no code around, I will write one up.
Thanks a bunch!
Best Answer