What’s the best way to check for the euclidean distance between two points when the boundary conditions are periodic? I’ve tried taking the minimum of the distance and (range – distance) but I think due to the way I’ve structured the program this is giving weird output. I’m hoping there’s another good way to approach this that I can adopt rather than reevaluating the rest of the function.
This is in Python btw. Currently finding euclidean distance with numpy.linalg.norm, though there are SciPy pdist routines that do the same thing that I might use I guess.
You should check separately on each dimension for what is smaller between dx and range-dx.