-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathearth.cpp
executable file
·48 lines (38 loc) · 1.05 KB
/
earth.cpp
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
#include "earth.h"
Earth:: Earth (void): Planet ()
{
Planet:: OrbitInfo info;
// http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html, January 2014
info.epochJDay = 2451545.00000;
info.keplerian.a = 1.00000011;
info.keplerian.e = 0.01671022;
info.keplerian.i = 0.00005;
info.keplerian.W = -11.26064;
info.keplerian.w = 102.94719 - info.keplerian.W;
info.keplerian.M0 = 100.46435 - info.keplerian.W - info.keplerian.w;
Planet:: setOrbitInfo (info);
}
Earth:: ~Earth (void)
{
//
}
int Earth:: setTargetTime (double julian_day)
{
Planet:: setTargetTime (julian_day);
updateGst ();
return 0;
}
void Earth:: getGst (double* gst) const
{
*gst = gst_;
}
void Earth:: updateGst (void)
{
const double Pi = M_PI;
double targetJDay;
Planet:: getTargetTime (&targetJDay);
double truncatedJDay;
tf:: convertJd2TJd (&truncatedJDay, targetJDay);
gst_ = (0.671262 + 1.0027379094 * truncatedJDay) * 2.0 * Pi; // http://ja.wikipedia.org/wiki/%E6%81%92%E6%98%9F%E6%99%82
tf:: normalizeRadian (&gst_);
}