#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(); } };