Use cubic polynomials with constraints on velocities to build trajectories.