function [xi,yi] = SplineInPlane(x,y,m)
% x,y represent coordinates of points on a curve in the plane
%
% we will compute spline interpolants to a parametric
% representation of the curve with a chord length parametrization
%
% returned are the coordinates of m points on the curve,
% equispaced in the parameter
%
n=length(x);
t=zeros(n,1);
if ((length(y) ~= n) | (n < 2))
disp(' x and y must have the same length >= 2 ')
else
t(1)=0;
for i=2:n
t(i)=t(i-1)+sqrt((x(i)-x(i-1))^2 + (y(i)-y(i-1))^2);
end
ti=linspace(0,t(n),m);
xi=spline(t,x,ti);
yi=spline(t,y,ti);
end