Files
pplus-library/modules/md/pair-distance/ref/python/plain.py
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

8 lines
165 B
Python

import math
def pair_distance(a, b, box):
d = [x - y for x, y in zip(a, b)]
d = [v - box * math.floor(v / box + 0.5) for v in d]
return math.hypot(*d)