double calcSunTrueLong(double t) { double l0 = calcGeomMeanLongSun(t); double c = calcSunEqOfCenter(t); double O = l0 + c; return O; // in degrees }
/* Purpose: calculate the difference between true solar time and mean * solar time (minutes) */ double calcEquationOfTime(double t) { double l0 = deg2rad(calcGeomMeanLongSun(t)); double e = calcEccentricityEarthOrbit(t); double m = deg2rad(calcGeomMeanAnomalySun(t)); double y = tan(deg2rad(calcObliquityCorrection(t))/2.0); double sinm = sin(m); y *= y; return rad2deg(y*sin(2.0*l0) - 2.0*e*sinm + 4.0*e*y*sinm*cos(2.0*l0) - 0.5*y*y*sin(4.0*l0) - 1.25*e*e*sin(2.0*m))*4.0; }
static double calcEquationOfTime( double t) { double epsilon = calcObliquityCorrection(t); double l0 = calcGeomMeanLongSun(t); double e = calcEccentricityEarthOrbit(t); double m = calcGeomMeanAnomalySun(t); double y = tan(degToRad(epsilon) / 2.0); y *= y; double sin2l0 = sin(2.0 * degToRad(l0)); double sinm = sin(degToRad(m)); double cos2l0 = cos(2.0 * degToRad(l0)); double sin4l0 = sin(4.0 * degToRad(l0)); double sin2m = sin(2.0 * degToRad(m)); double Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m; return radToDeg(Etime) * 4.0; // in minutes of time }
/* Purpose: calculate the true longitude of the sun (degrees) */ double calcSunTrueLong(double t) { return calcGeomMeanLongSun(t) + calcSunEqOfCenter(t); }