def mic(dr, cell, pbc=None):
<EOL>rec = np.linalg.inv(cell)<EOL>if pbc is not None:<EOL><INDENT>rec *= np.array(pbc, dtype=int).reshape(<NUM_LIT:3>,<NUM_LIT:1>)<EOL><DEDENT>dri = np.round(np.dot(dr, rec))<EOL>return dr - np.dot(dri, cell)<EOL>
Apply minimum image convention to an array of distance vectors.