def reduce_by_multiple(trajectory, integer):
    """
    keep only control points in given trajectory which are multiple of @integer
    :param trajectory: array that describes the trajectory
    :param integer: the multiple used for reducing
    :return: the reduced trajectory
    """
    reduced = trajectory[0:len(trajectory) - 1:integer]
    if len(reduced) == 0:
        return trajectory
    if reduced[-1] != trajectory[len(trajectory) - 1]:
        reduced.append(trajectory[len(trajectory) - 1])
    return reduced