def distance_matrix(a, b, periodic):
    '''Calculate a distrance matrix between coordinates sets a and b
    '''
    a = a
    b = b[:, np.newaxis]
    return periodic_distance(a, b, periodic)
Calculate a distrance matrix between coordinates sets a and b