Changeset 14851 for trunk/Mars


Ignore:
Timestamp:
02/04/13 09:53:50 (12 years ago)
Author:
tbretz
Message:
Made GetDevAbs more accurate.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mastro/MAstro.cc

    r9578 r14851  
    919919// All values given in deg, the return value, too.
    920920//
    921 Double_t MAstro::GetDevAbs(Double_t nomzd, Double_t devzd, Double_t devaz)
    922 {
    923     const Double_t pzd = nomzd * TMath::DegToRad();
    924     const Double_t azd = devzd * TMath::DegToRad();
    925     const Double_t aaz = devaz * TMath::DegToRad();
    926 
    927     const double el = TMath::Pi()/2-pzd;
    928 
    929     const double dphi2 = aaz/2.;
    930     const double cos2  = TMath::Cos(dphi2)*TMath::Cos(dphi2);
    931     const double sin2  = TMath::Sin(dphi2)*TMath::Sin(dphi2);
    932     const double d     = TMath::Cos(azd)*cos2 - TMath::Cos(2*el)*sin2;
    933 
    934     return TMath::ACos(d)*TMath::RadToDeg();
     921Double_t MAstro::GetDevAbs(Double_t nomzd, Double_t meszd, Double_t devaz)
     922{
     923    nomzd *= TMath::DegToRad();
     924    meszd *= TMath::DegToRad();
     925    devaz *= TMath::DegToRad();
     926
     927    const double x = sin(meszd) * sin(nomzd) * cos(dvaz);
     928    const double y = cos(meszd) * cos(nomzd);
     929
     930    return acos(x + y) * TMath::RadToDeg();
    935931}
    936932
Note: See TracChangeset for help on using the changeset viewer.