def diff_mic(pos1, pos2, cell):
  """Minimum image convention relative vector (orthorhombic cell only)"""
  diff = pos2 - pos1
  for i in range(3):
    diff[i] -= round(diff[i]/cell[i])*cell[i]
  return diff