function k=get_curvature(x,y)

xp1 = (x(3:end)-x(1:end-2))/2;
xp2=(xp1(3:end)-xp1(1:end-2))/2;

yp1 = (y(3:end)-y(1:end-2))/2;
yp2=(yp1(3:end)-yp1(1:end-2))/2;

k = zeros(length(x)-4,1);
for i=1:length(k)
    if(( xp1(i)^2 + yp1(i)^2 ) > 1e-4)
        k(i) = abs(xp1(i)*yp2(i) - yp1(i)*xp2(i))/( xp1(i)^2 + yp1(i)^2 )^(1.5);
    else
        k(i) = abs(xp1(i)*yp2(i) - yp1(i)*xp2(i))/( 1e-4 )^(1.5);
    end
end

