import math


def get_num_of_wps_during_const_spd_chg(v0, v1, a, dt_btw_wps):
    """
    Get the min number of waypoints the ego veh needs to pass before completing the constant speed change.
    Assume v0, v1 in m/s, a in m/s^2 and a has sign.
    """
    t = (v1 - v0) / a
    n_wps = math.ceil(t / dt_btw_wps)

    return n_wps