This work describes a method for weighted least squares approximation of an unbounded number of
data points using a B-spline function. The method can shift the bounded B-spline function
definition range during run-time. The approximation method is used for optimizing velocity
trajectories for an electric vehicle with respect to travel time comfort and energy
consumption. The trajectory optimization method is extended to a driver assistance system for
automated vehicle longitudinal control.