ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitCommon/MathTools/src/MathUtils.cc
(Generate patch)

Comparing UserCode/MitCommon/MathTools/src/MathUtils.cc (file contents):
Revision 1.11 by loizides, Wed Nov 4 12:44:33 2009 UTC vs.
Revision 1.12 by bendavid, Sat Dec 10 23:59:51 2011 UTC

# Line 84 | Line 84 | Double_t MathUtils::DeltaPhi(Double_t ph
84   {
85    // Compute DeltaPhi between two given angles. Results is in [-pi/2,pi/2].
86  
87 <  Double_t dphi = TMath::Abs(phi1-phi2);
88 <  while (dphi>TMath::Pi())
89 <    dphi = TMath::Abs(dphi - TMath::TwoPi());
87 >  Double_t dphi = phi1-phi2;
88 >  while (dphi > TMath::Pi())
89 >    dphi -= TMath::TwoPi();
90 >  while (dphi <= -TMath::Pi())
91 >    dphi += TMath::TwoPi();
92 >  
93 >  
94    return(dphi);
95 +  
96 +  
97   }
98  
99   //--------------------------------------------------------------------------------------------------

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines