trajectory piecewise