function Y = kreivumo_spindulys(K, Sp, T)
% syms t


l=1;
n=size(K, 1);
spindulys=zeros(n, 1);
kreivis=zeros(n, 1);
rasta=0;
for i=1:n
    rasta=0;
    while rasta==0
        clear a parametras pparam
        syms t
        f1=Sp(l,1)-K(i,1);
        a=solve(f1);
        param=double(a);
        k=size(param,1);
        for ii=1:k
            if isreal(param(ii))==1 && param(ii)>=T(l) && param(ii)<T(l+1)
                parametras=param(ii);
            end
        end
        if exist('parametras', 'var')==0
            l=l+1;
        else
            rasta=1;
        end
        
    end
    dx1=diff(Sp(l,1));
    dx2=diff(dx1);
    dy1=diff(Sp(l,2));
    dy2=diff(dy1);
    t=parametras;
    virsus=(eval(dx1)*eval(dy2))-eval(dx2)*eval(dy1);
    apacia=((eval(dx1))^2+(eval(dy1))^2)^(3/2);
    kreivis(i)=virsus/apacia;
    spindulys(i)=1/abs(kreivis(i));
%     koord=[eval(Tx) eval(Ty)];
    Y(i,:)=[spindulys(i) kreivis(i)];
end
