1 |
kusanagi |
1.1 |
//
|
2 |
|
|
// globals.h
|
3 |
|
|
//
|
4 |
|
|
#pragma once
|
5 |
|
|
|
6 |
|
|
#include "math.h"
|
7 |
|
|
|
8 |
|
|
const double PI = 3.141592653589793;
|
9 |
|
|
const double TWOPI = 2.0 * PI;
|
10 |
|
|
const double RADS_PER_DEG = PI / 180.0;
|
11 |
|
|
|
12 |
|
|
const double GM = 398601.2; // Earth gravitational constant, km^3/sec^2
|
13 |
|
|
const double GEOSYNC_ALT = 42241.892; // km
|
14 |
|
|
const double EARTH_DIA = 12800.0; // km
|
15 |
|
|
const double DAY_SIDERAL = (23 * 3600) + (56 * 60) + 4.09; // sec
|
16 |
|
|
const double DAY_24HR = (24 * 3600); // sec
|
17 |
|
|
|
18 |
|
|
const double AE = 1.0;
|
19 |
|
|
const double AU = 149597870.0; // Astronomical unit (km) (IAU 76)
|
20 |
|
|
const double SR = 696000.0; // Solar radius (km) (IAU 76)
|
21 |
|
|
const double TWOTHRD = 2.0 / 3.0;
|
22 |
|
|
const double XKMPER_WGS72 = 6378.135; // Earth equatorial radius - km (WGS '72)
|
23 |
|
|
const double F = 1.0 / 298.26; // Earth flattening (WGS '72)
|
24 |
|
|
const double GE = 398600.8; // Earth gravitational constant (WGS '72)
|
25 |
|
|
const double J2 = 1.0826158E-3; // J2 harmonic (WGS '72)
|
26 |
|
|
const double J3 = -2.53881E-6; // J3 harmonic (WGS '72)
|
27 |
|
|
const double J4 = -1.65597E-6; // J4 harmonic (WGS '72)
|
28 |
|
|
const double CK2 = J2 / 2.0;
|
29 |
|
|
const double CK4 = -3.0 * J4 / 8.0;
|
30 |
|
|
const double XJ3 = J3;
|
31 |
|
|
const double E6A = 1.0e-06;
|
32 |
|
|
const double QO = AE + 120.0 / XKMPER_WGS72;
|
33 |
|
|
const double S = AE + 78.0 / XKMPER_WGS72;
|
34 |
|
|
const double HR_PER_DAY = 24.0; // Hours per day (solar)
|
35 |
|
|
const double MIN_PER_DAY = 1440.0; // Minutes per day (solar)
|
36 |
|
|
const double SEC_PER_DAY = 86400.0; // Seconds per day (solar)
|
37 |
|
|
const double OMEGA_E = 1.00273790934; // earth rotation per sideral day
|
38 |
|
|
const double XKE = sqrt(3600.0 * GE / //sqrt(ge) ER^3/min^2
|
39 |
|
|
(XKMPER_WGS72 * XKMPER_WGS72 * XKMPER_WGS72));
|
40 |
|
|
const double QOMS2T = pow((QO - S), 4); //(QO - S)^4 ER^4
|
41 |
|
|
|
42 |
|
|
// Utility functions
|
43 |
|
|
double sqr (const double x);
|
44 |
|
|
double Fmod2p(const double arg);
|
45 |
|
|
double AcTan (const double sinx, double cosx);
|
46 |
|
|
|
47 |
|
|
double rad2deg(const double);
|
48 |
|
|
double deg2rad(const double);
|