tragGenLegendre: trajectory generation with legendre polynomials