[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-commit] [2342] Gathered some constant terms from equation_of_t
From: |
Mike Rice |
Subject: |
[avr-libc-commit] [2342] Gathered some constant terms from equation_of_time. c and solar_declination.c, into ephemera_common.h |
Date: |
Tue, 09 Apr 2013 20:04:59 +0000 |
Revision: 2342
http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2342
Author: swfltek
Date: 2013-04-09 20:04:59 +0000 (Tue, 09 Apr 2013)
Log Message:
-----------
Gathered some constant terms from equation_of_time.c and solar_declination.c,
into ephemera_common.h
Modified Paths:
--------------
trunk/avr-libc/libc/time/ephemera_common.h
trunk/avr-libc/libc/time/equation_of_time.c
trunk/avr-libc/libc/time/solar_declination.c
Modified: trunk/avr-libc/libc/time/ephemera_common.h
===================================================================
--- trunk/avr-libc/libc/time/ephemera_common.h 2013-04-08 20:24:58 UTC (rev
2341)
+++ trunk/avr-libc/libc/time/ephemera_common.h 2013-04-09 20:04:59 UTC (rev
2342)
@@ -37,5 +37,7 @@
#define PERIHELION 31316400 /* perihelion of 1999, 03 jan 13:00 UTC */
#define SOLSTICE 836160 /* winter solstice of 1999, 22 Dec 07:44 UTC */
#define TWO_PI 6.283185307179586
+#define TROP_CYCLE 5022440.6025
+#define ANOM_CYCLE 5022680.6082
#endif
Modified: trunk/avr-libc/libc/time/equation_of_time.c
===================================================================
--- trunk/avr-libc/libc/time/equation_of_time.c 2013-04-08 20:24:58 UTC (rev
2341)
+++ trunk/avr-libc/libc/time/equation_of_time.c 2013-04-09 20:04:59 UTC (rev
2342)
@@ -47,14 +47,13 @@
p = *timer % ANOM_YEAR;
p += PERIHELION;
pf = p;
- pf /= ANOM_YEAR;
- pf *= TWO_PI; /* anomalous orbital angle */
+ pf /= ANOM_CYCLE;
s = *timer % TROP_YEAR;
s += SOLSTICE;
sf = s;
- sf /= TROP_YEAR;
- sf *= 2.0 * TWO_PI; /* 2x tropical angle */
+ sf /= TROP_CYCLE;
+ sf *= 2.0; /* 2x tropical angle */
pf = sin(pf);
sf = sin(sf);
Modified: trunk/avr-libc/libc/time/solar_declination.c
===================================================================
--- trunk/avr-libc/libc/time/solar_declination.c 2013-04-08 20:24:58 UTC
(rev 2341)
+++ trunk/avr-libc/libc/time/solar_declination.c 2013-04-09 20:04:59 UTC
(rev 2342)
@@ -50,15 +50,13 @@
fT += SOLSTICE;
fT += LAG;
dT = fT;
- dT /= TROP_YEAR;
- dT *= TWO_PI;
+ dT /= TROP_CYCLE;
- /* Determine approximate orbital angle relative to perihelion */
+ /* Determine approximate orbital angle, relative to perihelion */
oV = *timer % ANOM_YEAR;
oV += PERIHELION;
dV = oV;
- dV /= ANOM_YEAR;
- dV *= TWO_PI;
+ dV /= ANOM_CYCLE;
/* Derive a velocity correction factor from the perihelion angle */
dV = sin(dV);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avr-libc-commit] [2342] Gathered some constant terms from equation_of_time. c and solar_declination.c, into ephemera_common.h,
Mike Rice <=