def get_intermediates(p1, p2, nb_points):
    x_spacing = (p2[0] - p1[0]) / (nb_points + 1)
    y_spacing = (p2[1] - p1[1]) / (nb_points + 1)

    return [
        [p1[0] + i * x_spacing, p1[1] + i * y_spacing] for i in range(1, nb_points + 1)
    ]
