def randomize_bodies(pos, vel, cluster_scale, velocity_scale, n):
    np.random.seed(42)
    scale = cluster_scale
    vscale = scale * velocity_scale
    inner = 2.5 * scale
    outer = 4.0 * scale

    i = 0
    while i < n:
        point = np.random.random(3) / 2.
        length = normalize(point)
        if length > 1.:
            continue
        pos[i,:3] = point * ((inner + (outer - inner)) * np.random.random(3))
        pos[i,3] = 1.0
        axis = np.array((0., 0., 1.))
        normalize(axis)
        if (1 - ((point * axis).sum())) < 1e-6:
            axis[0] = point[1]
            axis[1] = point[0]
            normalize(axis)
        vv = np.cross(pos[i,:3], axis)
        vel[i,:3] = vscale * vv
        vel[i,3]  = 1.0
        #print("%d: %s, %s" % (i, pos[i], vel[i]))
        i += 1
dataset/ETHPy150Open numba/numba/examples/nbody/nbody_modified_by_MarkHarris.py/randomize_bodies/original