function [Y] = Spline(P0, P1, T) t = [0.01:0.01:T]; Y = []; for i=1:length(t) a = (1 - cos(t(i)/T * pi))/2; Y = [Y, (1-a)*P0 + a*P1]; end end