-
Notifications
You must be signed in to change notification settings - Fork 0
/
Almanac.h
130 lines (104 loc) · 3.19 KB
/
Almanac.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#ifndef __ALMANAC_H__
#define __ALMANAC_H__
#include <time.h>
#include "Debug.h"
#include "Config.h"
#include <math.h>
class Almanac
{
public:
Almanac( Config cfg, time_t t = 0, double horizon = -50/60.0 );
void setNewTime( time_t t );
void setNewTime( struct tm * );
time_t sunrise;
time_t sunset;
int lengthOfDay;
// Private variables
private:
Debug dbg;
Config cfg;
float tz;
struct tm tm;
double julianDay;
double lon; // F6
double lat; // F7
double horizon;
private:
struct dataStruct
{
dataStruct( time_t t, int timeCorrection, double horizon, double lat, double lon, bool interpolate = true );
dataStruct *yesterday;
dataStruct *tomorrow;
double julianDay;
double lat;
double lon;
int leapSeconds; // G4
long double sunsMeanLongitude; // I13
long double moonsMeanLongitude; // K13
long double meanAnomalyOfTheSun; // L13
long double sunsEquationOfCenter; // M13
long double sunsTrueLongitude; // N13
long double moonsMeanAscendingNode; // O13
long double sunsApparentLongitude; // Q13
long double T; // G13
long double meanObliq; // R13
long double NutationInObliq; // S13
long double NutationInLong; // T13
long double TrueObliq; // U13
struct
{
long double declination; // V
long double rightAscention; // X
long double rightAscentionCorrected; // Y
} sunsApparent;
struct
{
long double mean; // AA
long double apparent; // AB
} siderealTimeAtMeridianAt0Hrs;
long double horizonToNoonAngle; // AD
long double approxTransitTime; // AF
struct
{
long double n, a, b, c; // For interpolation
long double rightAscention; // AK
long double siderealTimeAtGreenwich; // AM
long double hourAngle; // AO
} sunsInterpolated;
/*long double sunsActualRightAscention; // AK
long double siderealTimeAtGreenwich; // AM
long double rawHourAngle; // AN*/
long double approxRise; // AP
struct
{
long double n; // AQ
long double rightAscention; // AR
long double siderealTimeAtGreenwich; // AT
long double a, b, c; // AH AI AJ
long double declination; // AX
long double hourAngle; // AY
long double altitude; // AZ
} sunsInterpolatedApparent;
long double risingCorrection; // BA
long double approxSet; // BB;
struct
{
long double rightAscention; // BD;
long double declination; // BE;
long double siderealTimeAtGreenwich; // BG
long double hourAngle; // BH
long double altitude; // BI
long double n,a,b,c;
} setting;
long double settingCorrection; // BJ
/*long double transitTime;
long double riseTime;
long double setTime; */
time_t sunrise;
time_t sunset;
time_t transitTime;
int lengthOfDay;
};
public:
};
#endif