function s=arclength(x_p,y_p,T)
f = @(t) sqrt(x_p(t)^2+y_p(t)^2);
s = adapquad(f,0,T,.5e-6);