function [newdata] = data_maker(dataout,dd,ddd)


Nmax = max(size(dataout));


x = dataout;
ds = sqrt((dataout(2:Nmax,1)-dataout(1:Nmax-1,1)).^2+(dataout(2:Nmax,2)-dataout(1:Nmax-1,2)).^2);
ss = 0*x(:,1);

for i=2:Nmax,
    ss(i) = ss(i-1)+ds(i-1);
end;

r = 1:1000;

%x
%ss

xx = [x,ss];

newdata = [[r'],[r']];

s=0;
for i = 1:2000;
   % newdata(i,:) = interp_data(s,xx);
   newdata(i,:) = interp1(xx(:,3),xx(:,1:2),s,'spline');
    s = s+max(newdata(i,1)*dd,ddd);
    if s > xx(Nmax,3)
        'done'
        i
        break;
    end;
%    if newdata(i,1)==0
%        'done'
%        i
%        break;
%    end;
end;

newdata = newdata(1:i,:);