function [ft,tBreak]=essential_distMinAnglePair_ftFromQ(t,Q1,Q2,varargin)
kFlip=1;
term='both';

ivarargin=1;
while(ivarargin<=length(varargin))
    switch(lower(varargin{ivarargin}))
        case 'kflip'
            ivarargin=ivarargin+1;
            kFlip=varargin{ivarargin};
        case 'term'
            ivarargin=ivarargin+1;
            term=lower(varargin{ivarargin});
        otherwise
            disp(varargin{ivarargin})
            error('Argument not valid!')
    end
    ivarargin=ivarargin+1;
end


Q2=essential_flipAmbiguity(Q2,kFlip);

tBreak=[];
ft=0;
if strcmp(term,'first') || strcmp(term,'both')
    Q11=essential_getR1(Q1);
    Q21=essential_getR1(Q2);
    Q211=Q21*Q11';
    [tBreak1,~,~,c1,m1,p1]=essential_distMinAnglePair_discontinuityDistance(Q211);
    tBreak=[tBreak tBreak1];
    ft=ft+essential_distMinAnglePair_ft(t,m1,p1,c1);
end

if strcmp(term,'second') || strcmp(term,'both')
    Q22=essential_getR2(Q2);
    Q12=essential_getR2(Q1);
    Q212=Q22*Q12';
    [tBreak2,~,~,c2,m2,p2]=essential_distMinAnglePair_discontinuityDistance(Q212);
    tBreak=[tBreak tBreak2];
    ft=ft+essential_distMinAnglePair_ft(t,m2,p2,c2);
end
