% Fit a spline to a vector of points
function [xi,yi] = MySpline(x,y,n)

d = sqrt(diff(x).^2 + diff(y).^2);
m = length(x);
t = zeros(1,m);
for i = 2:m
t(i) = t(i-1) + d(i-1);
end

base = linspace(0,t(m),n);
xi = spline(t,x,base);
yi = spline(t,y,base);