function [ ksi] = bissection(f,a,b)
% function [ ksi ] = bissection(f,a,b)
%   Bissection method
%   f - inline function
%   [a,b] - interval

precision=0.000001;
fa=f(a);
fb=f(b);

if fa*fb>0
    error('The solution is not guaranteed.');
end
c=(a+b)/2;
fc=f(c);
n_it=0;
while abs(b-a)>precision
    if fa*fc>0 a=c; fa=fc;
    else b=c; fb=fc;
    end
    c=(a+b)/2;
    fc=f(c);
end
ksi=c;
end

