function Lygtis=Kontakto_tieses_lygtis(gama, XY0)
syms xr yr t
if gama==90 || gama==270 
    %benroji kontakto lygtis be krypties
    x=XY0(1,1);
  y=(yr-XY0(1,2))*t+XY0(1,2);
% y=t;
    Lygtis=[x y];
else
   L=tand(gama)-((yr-XY0(1,2))/(xr-XY0(1,1)));
   L=solve(L, 'yr');
   xr=t;
   yr=(eval(L));
   Lygtis=[xr yr];
end

