Skip to content

Commit

Permalink
Avant push
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Feb 10, 2017
1 parent 9641e39 commit 034525f
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/TpMMPD/TiePByMesh/TaskCorrel/cTriForTiepTri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,17 @@ double cTriForTiepTri::valElipse(int & aNInter)
aPtPIm0,aPtPIm1,aPtPIm2
);
//calcul vector max min pour choisir img master
double vecA_cr = aAffLc2Im.I10().x*aAffLc2Im.I10().x + aAffLc2Im.I10().y*aAffLc2Im.I10().y;
double vecB_cr = aAffLc2Im.I01().x*aAffLc2Im.I01().x + aAffLc2Im.I01().y*aAffLc2Im.I01().y;
double AB_cr = pow(aAffLc2Im.I10().x*aAffLc2Im.I01().x,2) + pow(aAffLc2Im.I10().y*aAffLc2Im.I01().y,2);
// double vecA_cr = aAffLc2Im.I10().x*aAffLc2Im.I10().x + aAffLc2Im.I10().y*aAffLc2Im.I10().y;
double vecA_cr = square_euclid(aAffLc2Im.I10());
// double vecB_cr = aAffLc2Im.I01().x*aAffLc2Im.I01().x + aAffLc2Im.I01().y*aAffLc2Im.I01().y;
double vecB_cr = square_euclid(aAffLc2Im.I01());


// double AB_cr = pow(aAffLc2Im.I10().x*aAffLc2Im.I01().x,2) + pow(aAffLc2Im.I10().y*aAffLc2Im.I01().y,2);

double AB_cr = ElSquare(scal(aAffLc2Im.I10(),aAffLc2Im.I01()));


//double theta_max = vecA_cr + vecB_cr +sqrt((vecA_cr - vecB_cr) + 4*AB_cr)*(0.5);
//Interaction : disp ellipse on image:
if (aNInter > 1)
Expand Down Expand Up @@ -138,7 +146,19 @@ double cTriForTiepTri::valElipse(int & aNInter)
if (mNumImg == int(mAppli->VVW().size() - 1))
aVW->clik_in();
}
return (vecA_cr + vecB_cr - sqrt((vecA_cr - vecB_cr) + 4*AB_cr)*(0.5));

double aDisc = ElSquare(vecA_cr - vecB_cr) + 4*AB_cr;

/*
std::cout <<"Discr = " << aDisc << "\n";
if (aDisc <0)
{
std::cout << "=====================\n";
getchar();
}
*/

return (vecA_cr + vecB_cr - sqrt(aDisc)) / 2.0 ;
}
else
{
Expand Down

0 comments on commit 034525f

Please sign in to comment.