SHARE
TWEET

отрефактори код

a guest Nov 28th, 2014 162 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool function(double dist0, double dist1, double dist2, double tolerance)
  2. {
  3.     const double minDist = mathlib::min(dist0, dist1, dist2);
  4.     if (minDist > tolerance)
  5.         return false;
  6.  
  7.     if (dist0 <= tolerance)
  8.     {
  9.         idx1 = trg0;
  10.         idx2 = trg1;
  11.         return true;
  12.     }
  13.  
  14.     if (dist1 <= tolerance)
  15.     {
  16.         idx1 = trg0;
  17.         idx2 = trg2;
  18.         return true;
  19.     }
  20.  
  21.     if (dist2 <= tolerance)
  22.     {
  23.         idx1 = trg1;
  24.         idx2 = trg2;
  25.         return true;
  26.     }
  27.  
  28.     return false;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top