function [ t] = part4( s ) tal = 2.495246747676093; % Total arc length %s = input('input the fraction of the curve you would like to know the time value for: '); tol=1e-6; % x = x-f(x)/df(x) f =@(t) sqrt((.3+7.8*t-14.1*t^2)^2+(.3+1.8*t-8.1*t^2)^2); t_vec=.5; t = t_vec; df = f(t); t_vec(2) = t - (adapquad(f_t,0,t,tol)-s*tal)/df; %x = x- func/dfunc % f_t = sqrt((.3+7.8*t-14.1*t^2)^2+(.3+1.8*t-8.1*t^2)^2) i=1; while abs(t_vec(i+1)-t_vec(i))>1e-5 i = i+1; t = t_vec(i); df = f(t); t_vec(i+1) = t - (adapquad(f_t,0,t,tol)-s*tal)/df; end partial_arc = adapquad(f_t,0,t,1e-6); Arc_length_over_partial = partial_arc/tal; end