Newer
Older
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
#pragma once
#include "Matrix.h"
struct precession_parameters {
double m_ζα;
double m_θα;
double m_zα;
};
struct fundamental_arguments {
double λ;
double l;
double L;
double F;
double D;
};
class RotationMatrix {
private:
const double m_rs = 4.848136811095 * pow(10, -6);
const double m_rg = 0.017453292519943296;
double m_ε{ 0 };
double Δψ{ 0 };
double Δε{ 0 };
double m_t{ 0 }, m_ts{ 0 };
Matrix m_precession{ 3,3 };
Matrix m_nutation{ 3,3 };
precession_parameters m_pp{ 0,0,0 };
fundamental_arguments m_fa{ 0,0,0,0,0 };
public:
RotationMatrix(double input_time = 0) : m_t{ input_time } { rewrite(); };
~RotationMatrix() {};
int settime(double input_TDB, bool i_rewrite = true) {
m_t = input_TDB;
if (i_rewrite) rewrite();
return 0;
}
int calculateTime() {
m_ts = (m_t - 51544.5) / double(36525);
return 0;
}
int calculatePrecessionParam();
int calculateMatrixPrecession();
int calculateAngleInclination() {
m_ε = m_rs * (84381.448 - (46.815 + (0.0059 - 0.001813 * m_t) * m_t) * m_t);
return 0;
}
int calculateFundamentalArguments();
int calculateNutationParameters();
int calculateMatrixNutation();
int rewrite();
double getΔψ() {
return Δψ;
}
double getε() {
return m_ε;
}
};
namespace coord_sys {
Matrix Earth_rot_matrix(double GTST) {
return Matrix::RotationOZ(GTST);
}
Matrix AEC_to_CC(Matrix& Precession) {
return (Precession.Transpose());
}
Matrix CC_to_TEC(Matrix& Precession, Matrix& Nutation) {
return (Nutation * Precession);
}
Matrix TEC_to_CC(Matrix& TEC) {
return TEC.Transpose();
}
Matrix CC_to_TC(Matrix& Precession, Matrix& Nutation, Matrix& ERM) {
Matrix buf = CC_to_TEC(Precession, Nutation);
return (ERM * buf);
}
Matrix TC_to_CC(Matrix& CC_to_TC) {
return CC_to_TC.Transpose();
}
};