<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

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)