The problem is my box is not orthorhombic (base angles different than 90 degrees). So, I am getting wrong results with the formula,
def distance(a, b): dx = abs(a - b) x = min(dx, abs(A - dx)) dy = abs(a - b) y = min(dy, abs(B - dy)) dz = abs(a - b) z = min(dz, abs(C - dz)) return sp.sqrt(x**2 + y**2 + z**2)
Any suggestion on how to get the proper distance between any atom and its neighbours, including the periodic images of the neighbours. Basically, it makes the results of RDF and CN unphysical.