Changeset 12881 for trunk


Ignore:
Timestamp:
02/09/12 12:49:22 (13 years ago)
Author:
tbretz
Message:
Fixed another bug in the wobble calculation; the declination was in fact theta, so dec should be 90-dec
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/drivectrl.cc

    r12878 r12881  
    843843        }
    844844
    845         const double costheta = cosdec*cosoff + sindec*sinoff*cosdir;
    846         if (costheta >= 1)
     845        const double sintheta = sindec*cosoff + cosdec*sinoff*cosdir;
     846        if (sintheta >= 1)
    847847        {
    848848            T::Error("cos(Zd) > 1");
     
    850850        }
    851851
    852         const double sintheta = sqrt(1 - costheta*costheta);
    853 
    854         const double cosdeltara = (cosoff - cosdec*costheta)/(sindec*sintheta);
    855         const double sindeltara = sindir*sinoff/sintheta;
    856 
    857         const double ndec = acos(costheta)*180/M_PI;
     852        const double costheta = sqrt(1 - sintheta*sintheta);
     853
     854        const double cosdeltara = (cosoff - sindec*sintheta)/(cosdec*costheta);
     855        const double sindeltara = sindir*sinoff/costheta;
     856
     857        const double ndec = asin(sintheta)*180/M_PI;
    858858        const double nra  = (atan2(sindeltara, cosdeltara) + ra)*12/M_PI;
    859859
Note: See TracChangeset for help on using the changeset viewer.