def distance(x, y, z, m):
    '\n    Distances calculator.\n\n    Calculate distances beetween particles.\n\n    Parameters\n    ----------\n    x, y, z: `np.ndarray`, shape = (N_part, 1)\n        Positions\n    m : `np.ndarray`, shape = (N_part, 1)\n        Masses\n\n    Returns\n    -------\n    dx, dy, dz: `np.ndarray`, shape = (N_part, N_part)\n        Distances between particles.\n    '
    N_part = len(m)
    dx = np.zeros((N_part, N_part))
    dy = np.zeros((N_part, N_part))
    dz = np.zeros((N_part, N_part))
    for i in range(0, (N_part - 1)):
        for j in range((i + 1), N_part):
            dx[(i, j)] = (x[j] - x[i])
            dy[(i, j)] = (y[j] - y[i])
            dz[(i, j)] = (z[j] - z[i])
            dx[(j, i)] = (- dx[(i, j)])
            dy[(j, i)] = (- dy[(i, j)])
            dz[(j, i)] = (- dz[(i, j)])
    return (dx, dy, dz)
Distances calculator.

Calculate distances beetween particles.

Parameters
----------
x, y, z: `np.ndarray`, shape = (N_part, 1)
    Positions
m : `np.ndarray`, shape = (N_part, 1)
    Masses

Returns
-------
dx, dy, dz: `np.ndarray`, shape = (N_part, N_part)
    Distances between particles.
def distance(x, y, z, m):
    '\n    Distances calculator.\n\n    Calculate distances beetween particles.\n\n    Parameters\n    ----------\n    x, y, z: `np.ndarray`, shape = (N_part, 1)\n        Positions\n    m : `np.ndarray`, shape = (N_part, 1)\n        Masses\n\n    Returns\n    -------\n    dx, dy, dz: `np.ndarray`, shape = (N_part, N_part)\n        Distances between particles.\n    '
    N_part = len(m)
    dx = np.zeros((N_part, N_part))
    dy = np.zeros((N_part, N_part))
    dz = np.zeros((N_part, N_part))
    for i in range(0, (N_part - 1)):
        for j in range((i + 1), N_part):
            dx[(i, j)] = (x[j] - x[i])
            dy[(i, j)] = (y[j] - y[i])
            dz[(i, j)] = (z[j] - z[i])
            dx[(j, i)] = (- dx[(i, j)])
            dy[(j, i)] = (- dy[(i, j)])
            dz[(j, i)] = (- dz[(i, j)])
    return (dx, dy, dz)