t=0:0.005:5;
x=4*cos(3*t);
y=4*sin(3*t);
z=2*t;
c=3^(1/2)/12;
a=288*c;
b=a/2;
l=((-c*b+c*a+x).^2+(-b/4+a/4+y).^2+z.^2).^(1/2);
n=length(t);
s1=diag(ones(1,n-1),-1)+diag(ones(1,n));
s1(:,end)=[];
s2=s1(1:end-1,1:end-1);
t1=t*s1/2;
t2=t1*s2/2;
v11=diff(l);
v12=diff(l,2);
subplot(2,1,1)
plot(t1,v11)
subplot(2,1,2)
plot(t2,v12)