double UTCForSolarAngleAux( int rise, double jd, double latitudeRad, double angleRad) { double centuryTime = JulianCenturyFromJulianDay( jd); double equationOfTime = EquationOfTime(centuryTime); double sunDeclinationRad = SunDeclinationRad(centuryTime); double hourAngle = LocalHourAngleSunRad( latitudeRad, sunDeclinationRad, angleRad); if (!rise) { hourAngle = -hourAngle; } return 720.0 - (4.0 * RAD2DEG(hourAngle)) - equationOfTime; /* minutes */ }
bool TestEquationOfTime( ) { bool ok = true; cout << "Testing EquationOfTime" << endl; int prec = cout.precision( 12 ); double jd = 2448908.5; cout << "jd = " << jd << endl; TESTCHECKFE( EquationOfTime( jd ).Days(), TimeIncrement( 0, 13, 42.6 ).Days(), &ok, 1e-4 ); cout.precision( prec ); if ( ok ) cout << "EquationOfTime PASSED." << endl << endl; else cout << "EquationOfTime FAILED." << endl << endl; return ok; }