Skip to content
Snippets Groups Projects
Commit 4de45874 authored by GASpiridonov's avatar GASpiridonov
Browse files

Доработан класс и функции преобразования систем координат

Добавлен класс планет
parent a3216b9d
No related branches found
No related tags found
No related merge requests found
#include "Matrix.h" #include "Matrix.h"
Matrix operator+(Matrix& matrix_1, Matrix& matrix_2) Matrix operator+(Matrix& matrix_1, Matrix& matrix_2)
{ {
Matrix output(matrix_1.m_rows, matrix_1.m_cols); Matrix output(matrix_1.m_rows, matrix_1.m_cols);
......
...@@ -40,7 +40,6 @@ public: ...@@ -40,7 +40,6 @@ public:
static Matrix RotationOZ(double α); static Matrix RotationOZ(double α);
friend std::ostream& operator<<(std::ostream& out, Matrix& matrix_1); friend std::ostream& operator<<(std::ostream& out, Matrix& matrix_1);
}; };
......
#include "Planets.h"
int Moon::calculate_s() {
m_s.at(0) = sin(1.24614 + 0.35255 * m_ts);
m_s.at(1) = sin(1.75106 + 0.28325 * m_ts);
m_s.at(2) = sin(1.05727 - 2.31868 * m_ts);
m_s.at(3) = sin(2.18240 - 33.7571 * m_ts);
m_s.at(4) = sin(0.65961 - 33.79719 * m_ts);
m_s.at(5) = sin(2.68173 - 2.62983 * m_ts);
m_s.at(6) = sin(0.93890 - 33.77281 * m_ts);
return 0;
};
int Moon::calculate_r() {
calculate_s();
m_r.at(0) = 0.84 * m_s.at(0) + 0.31 * m_s.at(1) + 14.27 * m_s.at(2) + 7.26 * m_s.at(3) + 0.28 * m_s.at(4) + 0.24 * m_s.at(5);
m_r.at(1) = 2.94 * m_s.at(0) + 0.31 * m_s.at(1) + 14.27 * m_s.at(2) + 9.34 * m_s.at(3) + 1.12 * m_s.at(4) + 0.83 * m_s.at(5);
m_r.at(2) = -6.4 * m_s.at(0) - 1.89 * m_s.at(5);
m_r.at(3) = 0.21 * m_s.at(0) + 0.31 * m_s.at(1) + 14.27 * m_s.at(2) - 88.7 * m_s.at(3) - 15.3 * m_s.at(4) + 0.24 * m_s.at(5) - 1.86 * m_s.at(6);
m_r.at(4) = 7.24 * m_s.at(0) + 0.31 * m_s.at(1) + 14.27 * m_s.at(2) + 7.26 * m_s.at(3) + 0.28 * m_s.at(4) + 2.13 * m_s.at(5);
return 0;
}
int Moon::calculate_sin_πс()
{
m_sin_πс = +3422.7 + 0.260968 * cos(4 * m_cfa.D) + 28.233869 * cos(2 * m_cfa.D) + 0.043566 * cos(m_cfa.l + 4 * m_cfa.D)
+ 3.08589 * cos(m_cfa.l + 2 * m_cfa.D) + 186.539296 * cos(m_cfa.l) + 34.311569 * cos(m_cfa.l - 2 * m_cfa.D)
+ 0.60071 * cos(m_cfa.l - 4 * m_cfa.D) - 0.300334 * cos(m_cfa.L + 2 * m_cfa.D) - 0.399822 * cos(m_cfa.L)
+ 1.916735 * cos(m_cfa.L - 2 * m_cfa.D) + 0.034671 * cos(m_cfa.L - 4 * m_cfa.D) - 0.977818 * cos(m_cfa.D)
+ 0.282799 * cos(2 * m_cfa.l + 2 * m_cfa.D) + 10.165933 * cos(2 * m_cfa.l) - 0.304041 * cos(2 * m_cfa.l - 2 * m_cfa.D)
+ 0.372337 * cos(2 * m_cfa.l - 4 * m_cfa.D) - 0.949147 * cos(m_cfa.l + m_cfa.L) + 1.443617 * cos(m_cfa.l + m_cfa.L - 2 * m_cfa.D)
+ 0.067283 * cos(m_cfa.l + m_cfa.L - 4 * m_cfa.D) + 0.229935 * cos(m_cfa.l - m_cfa.L + 2 * m_cfa.D) + 1.152852 * cos(m_cfa.l - m_cfa.L)
- 0.225821 * cos(m_cfa.l - m_cfa.L - 2 * m_cfa.D) - 0.008639 * cos(2 * m_cfa.L) + 0.091646 * cos(2 * m_cfa.L - 2 * m_cfa.D)
- 0.012103 * cos(2 * m_cfa.F) - 0.105291 * cos(2 * m_cfa.F - 2 * m_cfa.D) - 0.109456 * cos(m_cfa.l + m_cfa.D)
+ 0.011715 * cos(m_cfa.l - m_cfa.D) - 0.038258 * cos(m_cfa.l - 3 * m_cfa.D) + 0.149444 * cos(m_cfa.L + m_cfa.D)
- 0.118714 * cos(3 * m_cfa.l - 2 * m_cfa.D) - 0.047853 * cos(m_cfa.l - 2 * m_cfa.F + 2 * m_cfa.D)
- 0.708093 * cos(m_cfa.l - 2 * m_cfa.F) - 0.048117 * cos(m_cfa.l + m_cfa.L + 2 * m_cfa.D)
+ 0.621546 * cos(3 * m_cfa.l) - 0.103337 * cos(2 * m_cfa.l + m_cfa.L) - 0.083228 * cos(m_cfa.l + 2 * m_cfa.F - 2 * m_cfa.D);
return 0;
}
int Moon::calculate_Δλ_c()
{
m_Δλ_c = +13.90 * sin(4 * m_cfa.D) + 2369.92 * sin(2 * m_cfa.D) + 1.98 * sin(m_cfa.l + 4 * m_cfa.D) + 191.96 * sin(m_cfa.l + 2 * m_cfa.D)
- 4586.47 * sin(m_cfa.l - 2 * m_cfa.D) - 38.43 * sin(m_cfa.l - 4 * m_cfa.D) - 24.42 * sin(m_cfa.L + 2 * m_cfa.D) - 668.15 * sin(m_cfa.L)
- 165.15 * sin(m_cfa.L - 2 * m_cfa.D) - 1.88 * sin(m_cfa.L - 4 * m_cfa.D) - 125.15 * sin(m_cfa.D) + 14.38 * sin(2 * m_cfa.l + 2 * m_cfa.D)
+ 769.02 * sin(2 * m_cfa.l) - 211.66 * sin(2 * m_cfa.l - 2 * m_cfa.D) - 30.77 * sin(2 * m_cfa.l - 4 * m_cfa.D)
- 2.92 * sin(m_cfa.l + m_cfa.L + 2 * m_cfa.D) - 109.67 * sin(m_cfa.l + m_cfa.L) - 205.96 * sin(m_cfa.l + m_cfa.L - 2 * m_cfa.D)
- 4.39 * sin(m_cfa.l + m_cfa.L - 4 * m_cfa.D) + 14.57 * sin(m_cfa.l - m_cfa.L + 2 * m_cfa.D) + 147.69 * sin(m_cfa.l - m_cfa.L)
+ 28.47 * sin(m_cfa.l - m_cfa.L - 2 * m_cfa.D) - 7.49 * sin(2 * m_cfa.L) - 8.09 * sin(2 * m_cfa.L - 2 * m_cfa.D) - 5.74 * sin(2 * m_cfa.F + 2 * m_cfa.D)
- 411.60 * sin(2 * m_cfa.F) - 55.17 * sin(2 * m_cfa.F - 2 * m_cfa.D) - 8.46 * sin(m_cfa.l + m_cfa.D) + 18.61 * sin(m_cfa.l - m_cfa.D)
+ 3.21 * sin(m_cfa.l - 3 * m_cfa.D) + 18.02 * sin(m_cfa.L + m_cfa.D) + 0.56 * sin(m_cfa.L - m_cfa.D) + 36.12 * sin(3 * m_cfa.l)
- 13.19 * sin(3 * m_cfa.l - 2 * m_cfa.D) - 7.65 * sin(2 * m_cfa.l + m_cfa.L) + 9.70 * sin(2 * m_cfa.l - m_cfa.L)
- 2.49 * sin(2 * m_cfa.l - m_cfa.L - 2 * m_cfa.D) - 0.99 * sin(m_cfa.l + 2 * m_cfa.F + 2 * m_cfa.D) - 45.10 * sin(m_cfa.l + 2 * m_cfa.F)
- 6.38 * sin(m_cfa.l - 2 * m_cfa.F + 2 * m_cfa.D) + 39.53 * sin(m_cfa.l - 2 * m_cfa.F) + 1.75 * sin(2 * m_cfa.l - m_cfa.D)
+ 22639.50 * sin(m_cfa.l) - 0.57 * sin(2 * m_cfa.l - 6 * m_cfa.D) + 0.64 * sin(m_cfa.l - m_cfa.L - 4 * m_cfa.D)
+ 1.06 * sin(3 * m_cfa.l + 2 * m_cfa.D) - 1.19 * sin(3 * m_cfa.l - 4 * m_cfa.D) - 8.63 * sin(2 * m_cfa.l + m_cfa.L - 2 * m_cfa.D)
- 2.74 * sin(2 * m_cfa.l + m_cfa.L - 4 * m_cfa.D) + 1.18 * sin(2 * m_cfa.l - m_cfa.L + 2 * m_cfa.D) - 1.17 * sin(m_cfa.l + 2 * m_cfa.L)
- 7.41 * sin(m_cfa.l + 2 * m_cfa.L - 2 * m_cfa.D) + 0.76 * sin(m_cfa.l - 2 * m_cfa.L + 2 * m_cfa.D) + 2.58 * sin(m_cfa.l - 2 * m_cfa.L)
+ 2.53 * sin(m_cfa.l - 2 * m_cfa.L - 2 * m_cfa.D) + 9.37 * sin(m_cfa.l - 2 * m_cfa.F - 2 * m_cfa.D)
- 2.15 * sin(m_cfa.L + 2 * m_cfa.F - 2 * m_cfa.D) - 1.44 * sin(m_cfa.L - 2 * m_cfa.F + 2 * m_cfa.D) - 0.59 * sin(2 * m_cfa.l + m_cfa.D)
+ 1.22 * sin(2 * m_cfa.l - 3 * m_cfa.D) + 1.27 * sin(m_cfa.l + m_cfa.L + m_cfa.D) - 1.09 * sin(m_cfa.l - m_cfa.L - m_cfa.D)
+ 0.58 * sin(2 * m_cfa.F - m_cfa.D) + 1.94 * sin(4 * m_cfa.l) - 0.95 * sin(4 * m_cfa.l - 2 * m_cfa.D) - 0.55 * sin(3 * m_cfa.l + m_cfa.L)
+ 0.67 * sin(3 * m_cfa.l - m_cfa.L) - 4.00 * sin(2 * m_cfa.l + 2 * m_cfa.F) + 0.56 * sin(2 * m_cfa.l + 2 * m_cfa.F - 2 * m_cfa.D)
- 1.30 * sin(2 * m_cfa.l - 2 * m_cfa.F) + 0.54 * sin(2 * m_cfa.l - 2 * m_cfa.F - 2 * m_cfa.D);
return 0;
}
int Moon::calculate_β()
{
m_β = +117.26 * sin(m_cfa.F + 2 * m_cfa.D) + 18461.35 * sin(m_cfa.F) - 623.66 * sin(m_cfa.F - 2 * m_cfa.D) - 3.67 * sin(m_cfa.F - 4 * m_cfa.D)
+ 15.12 * sin(m_cfa.l + m_cfa.F + 2 * m_cfa.D) - 166.58 * sin(m_cfa.l + m_cfa.F - 2 * m_cfa.D) - 6.58 * sin(m_cfa.l + m_cfa.F - 4 * m_cfa.D)
+ 3.00 * sin(-m_cfa.l + m_cfa.F + 4 * m_cfa.D) + 199.49 * sin(-m_cfa.l + m_cfa.F + 2 * m_cfa.D) - 999.69 * sin(-m_cfa.l + m_cfa.F)
- 33.36 * sin(-m_cfa.l + m_cfa.F - 2 * m_cfa.D) - 6.48 * sin(m_cfa.L + m_cfa.F) - 29.65 * sin(m_cfa.L + m_cfa.F - 2 * m_cfa.D)
+ 7.98 * sin(-m_cfa.L + m_cfa.F + 2 * m_cfa.D) + 4.86 * sin(-m_cfa.L + m_cfa.F) - 5.38 * sin(m_cfa.F + m_cfa.D) + 4.81 * sin(m_cfa.F - m_cfa.D)
- 15.57 * sin(2 * m_cfa.l + m_cfa.F - 2 * m_cfa.D) - 31.76 * sin(-2 * m_cfa.l + m_cfa.F) - 5.33 * sin(m_cfa.l + m_cfa.L + m_cfa.F)
+ 8.89 * sin(-m_cfa.l - m_cfa.L + m_cfa.F + 2 * m_cfa.D) + 6.75 * sin(m_cfa.l - m_cfa.L + m_cfa.F) - 5.65 * sin(-m_cfa.l + m_cfa.L + m_cfa.F)
- 1.02 * sin(m_cfa.l + 3 * m_cfa.F) + 1.19 * sin(m_cfa.F + 4 * m_cfa.D) + 1010.16 * sin(m_cfa.l + m_cfa.F) - 1.26 * sin(m_cfa.L + m_cfa.F + 2 * m_cfa.D)
+ 12.12 * sin(-m_cfa.L + m_cfa.F - 2 * m_cfa.D) - 6.29 * sin(3 * m_cfa.F) - 2.18 * sin(3 * m_cfa.F - 2 * m_cfa.D)
+ 1.51 * sin(2 * m_cfa.l + m_cfa.F + 2 * m_cfa.D) + 61.91 * sin(2 * m_cfa.l + m_cfa.F) + 2.41 * sin(-2 * m_cfa.l + m_cfa.F + 4 * m_cfa.D)
- 1.62 * sin(-2 * m_cfa.l + m_cfa.F + 2 * m_cfa.D) - 2.14 * sin(-2 * m_cfa.l + m_cfa.F - 2 * m_cfa.D)
- 7.45 * sin(m_cfa.l + m_cfa.L + m_cfa.F - 2 * m_cfa.D) + 5.08 * sin(-m_cfa.l - m_cfa.L + m_cfa.F)
+ 1.13 * sin(m_cfa.l - m_cfa.L + m_cfa.F + 2 * m_cfa.D) - 1.32 * sin(-m_cfa.l + m_cfa.L + m_cfa.F + 2 * m_cfa.D)
- 1.77 * sin(-m_cfa.l + m_cfa.L + m_cfa.F - 2 * m_cfa.D) - 1.09 * sin(2 * m_cfa.L + m_cfa.F - 2 * m_cfa.D)
- 2.79 * sin(-m_cfa.l + 3 * m_cfa.F) + 3.98 * sin(3 * m_cfa.l + m_cfa.F) - 1.51 * sin(3 * m_cfa.l + m_cfa.F - 2 * m_cfa.D)
- 1.58 * sin(-3 * m_cfa.l + m_cfa.F);
return 0;
}
int Moon::calculateGEC()
{
calculate_Δλ_c();
calculate_β();
calculate_sin_πс();
m_GEC(0,0) = m_cfa.λ + RS * m_Δλ_c;
m_GEC(1,0) = RS * m_β;
m_GEC(2,0) = m_scalefactor * (1 / (RS * m_sin_πс));
return 0;
}
int Moon::calculateDC()
{
calculateGEC();
Matrix buff1 = AEC_to_CC(m_precession);
Matrix buff2 = Matrix::RotationOX(-m_ε);
Matrix R = buff1 * buff2;
m_dc = SC_to_DC(m_GEC);
m_dc = R * m_dc;
return 0;
}
int Moon::calculateСorrecteFundamentalArg() {
calculate_r();
m_cfa.λ = m_fa.λ + RS * m_r.at(0);
m_cfa.l = m_fa.l + RS * m_r.at(1);
m_cfa.L = m_fa.L + RS * m_r.at(2);
m_cfa.F = m_fa.F + RS * m_r.at(3);
m_cfa.D = m_fa.D + RS * m_r.at(4);
return 0;
}
std::ostream& operator<<(std::ostream& out, Moon& i_moon)
{
out << "\n******************************************"
<< i_moon
<< "\nm_s = " << i_moon.m_s.at(0) << " " << i_moon.m_s.at(1) << " " << i_moon.m_s.at(2) << " "
<< i_moon.m_s.at(3) << " " << i_moon.m_s.at(4) << " " << i_moon.m_s.at(5) << " "
<< i_moon.m_s.at(6) << " " << i_moon.m_s.at(7)
<< "\nr_s = " << i_moon.m_r.at(0) << " " << "\nr_s = " << i_moon.m_r.at(1) << " "
<< "\nr_s = " << i_moon.m_r.at(2) << " " << "\nr_s = " << i_moon.m_r.at(3) << " " << "\nr_s = " << i_moon.m_r.at(4)
<< "\nm_cfa = " << i_moon.m_cfa << "\nm_Δλ_c = " << i_moon.m_Δλ_c << "\nm_β = " << i_moon.m_β << "\nm_sin_πс = " << i_moon.m_sin_πс
<< "\nm_GEC: " << i_moon.m_GEC << "\nm_dc:" << i_moon.m_dc;
return out;
}
std::ofstream& operator<<(std::ofstream& out, Moon& i_moon)
{
out << i_moon;
return out;
}
#pragma once
#include "SystemCoords.h"
class Moon : private ConvertSC {
private:
double m_sin_πс;
double m_Δλ_c;
double m_β;
const double m_scalefactor = 6378.43817285;
std::vector<double> m_s{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
std::vector<double> m_r{ 0.0, 0.0, 0.0, 0.0, 0.0 };
fundamental_arguments m_cfa{ 0.0, 0.0, 0.0, 0.0, 0.0 };
Matrix m_GEC{ 3, 1 };
Matrix m_dc{ 3, 1 };
public:
Moon(double input_TDB = 0) :ConvertSC{ input_TDB } {
calculateDC();
};
~Moon() {};
int calculate_s();
int calculate_r();
int calculateСorrecteFundamentalArg();
int calculate_sin_πс();
int calculate_Δλ_c();
int calculate_β();
int calculateGEC();
int calculateDC();
int recalc(double input_time = 0) {
settime(input_time);
calculateDC();
}
friend std::ostream& operator<<(std::ostream& out, Moon& i_moon);
friend std::ofstream& operator<<(std::ofstream& out, Moon& i_moon);
};
\ No newline at end of file
#include "RotationMatrix.h" #include "SystemCoords.h"
int RotationMatrix::calculatePrecessionParam() { int ConvertSC::calculatePrecessionParam() {
m_pp.m_ζα = m_rs * (2306.2181 + (0.30188 + 0.017998 * m_ts) * m_ts) * m_ts; m_pp.m_ζα = RS * (2306.2181 + (0.30188 + 0.017998 * m_ts) * m_ts) * m_ts;
m_pp.m_θα = m_rs * (2004.3109 - (0.42665 + 0.041833 * m_ts) * m_ts) * m_ts; m_pp.m_θα = RS * (2004.3109 - (0.42665 + 0.041833 * m_ts) * m_ts) * m_ts;
m_pp.m_zα = m_rs * (2306.2181 + (1.09468 + 0.018203 * m_ts) * m_ts) * m_ts; m_pp.m_zα = RS * (2306.2181 + (1.09468 + 0.018203 * m_ts) * m_ts) * m_ts;
return 0; return 0;
} }
int RotationMatrix::calculateMatrixPrecession() { int ConvertSC::calculateMatrixPrecession() {
Matrix a = Matrix::RotationOY(m_pp.m_θα); Matrix a = Matrix::RotationOY(m_pp.m_θα);
Matrix b = Matrix::RotationOZ(-m_pp.m_ζα); Matrix b = Matrix::RotationOZ(-m_pp.m_ζα);
Matrix c = Matrix::RotationOZ(-m_pp.m_zα); Matrix c = Matrix::RotationOZ(-m_pp.m_zα);
...@@ -15,7 +15,7 @@ int RotationMatrix::calculateMatrixPrecession() { ...@@ -15,7 +15,7 @@ int RotationMatrix::calculateMatrixPrecession() {
return 0; return 0;
} }
int RotationMatrix::calculateFundamentalArguments() { int ConvertSC::calculateFundamentalArguments() {
m_fa.λ = m_rg * (218.31643250 + (481267.8812772222 - (0.00161167 - 0.00000528 * m_ts) * m_ts) * m_ts); m_fa.λ = m_rg * (218.31643250 + (481267.8812772222 - (0.00161167 - 0.00000528 * m_ts) * m_ts) * m_ts);
m_fa.l = m_rg * (134.96298139 + (477198.8673980556 + (0.00869722 + 0.00001778 * m_ts) * m_ts) * m_ts); m_fa.l = m_rg * (134.96298139 + (477198.8673980556 + (0.00869722 + 0.00001778 * m_ts) * m_ts) * m_ts);
m_fa.L = m_rg * (357.52772333 + (35999.05034 - (0.00016028 + 0.00000333 * m_ts) * m_ts) * m_ts); m_fa.L = m_rg * (357.52772333 + (35999.05034 - (0.00016028 + 0.00000333 * m_ts) * m_ts) * m_ts);
...@@ -24,8 +24,8 @@ int RotationMatrix::calculateFundamentalArguments() { ...@@ -24,8 +24,8 @@ int RotationMatrix::calculateFundamentalArguments() {
return 0; return 0;
} }
int RotationMatrix::calculateNutationParameters() { int ConvertSC::calculateNutationParameters() {
Δψ = m_rs * ((-17.1996 - 0.01742 * m_ts) * sin(m_fa.λ - m_fa.F) + (0.2062 + 0.00002 * m_ts) * sin(2 * m_fa.λ - 2 * m_fa.F) + Δψ = RS * ((-17.1996 - 0.01742 * m_ts) * sin(m_fa.λ - m_fa.F) + (0.2062 + 0.00002 * m_ts) * sin(2 * m_fa.λ - 2 * m_fa.F) +
0.0046 * sin(m_fa.λ - 2 * m_fa.l + m_fa.F) + 0.0011 * sin(2 * m_fa.l - 2 * m_fa.F) - 0.0046 * sin(m_fa.λ - 2 * m_fa.l + m_fa.F) + 0.0011 * sin(2 * m_fa.l - 2 * m_fa.F) -
(1.3187 + 0.00016 * m_ts) * sin(2 * m_fa.λ - 2 * m_fa.D) + (0.1426 - 0.00034 * m_ts) * sin(m_fa.L) - (1.3187 + 0.00016 * m_ts) * sin(2 * m_fa.λ - 2 * m_fa.D) + (0.1426 - 0.00034 * m_ts) * sin(m_fa.L) -
(0.0517 - 0.00012 * m_ts) * sin(2 * m_fa.λ + m_fa.L - 2 * m_fa.D) + (0.0217 - 0.00005 * m_ts) * (0.0517 - 0.00012 * m_ts) * sin(2 * m_fa.λ + m_fa.L - 2 * m_fa.D) + (0.0217 - 0.00005 * m_ts) *
...@@ -34,7 +34,7 @@ int RotationMatrix::calculateNutationParameters() { ...@@ -34,7 +34,7 @@ int RotationMatrix::calculateNutationParameters() {
(0.0016 - 0.00001 * m_ts) * sin(2 * m_fa.λ + 2 * m_fa.L - 2 * m_fa.D) - 0.0015 * sin(m_fa.λ + m_fa.L - m_fa.F) - (0.0016 - 0.00001 * m_ts) * sin(2 * m_fa.λ + 2 * m_fa.L - 2 * m_fa.D) - 0.0015 * sin(m_fa.λ + m_fa.L - m_fa.F) -
0.0012 * sin(m_fa.λ - m_fa.L - m_fa.F)); 0.0012 * sin(m_fa.λ - m_fa.L - m_fa.F));
Δψ += m_rs * ((-0.2274 - 0.00002 * m_ts) * sin(2 * m_fa.λ) + (0.0712 + 0.00001 * m_ts) * sin(m_fa.l) - Δψ += RS * ((-0.2274 - 0.00002 * m_ts) * sin(2 * m_fa.λ) + (0.0712 + 0.00001 * m_ts) * sin(m_fa.l) -
(0.0386 + 0.00004 * m_ts) * sin(m_fa.λ + m_fa.F) - 0.0301 * sin(2 * m_fa.λ + m_fa.l) - 0.0158 * sin(m_fa.l - 2 * m_fa.D) + (0.0386 + 0.00004 * m_ts) * sin(m_fa.λ + m_fa.F) - 0.0301 * sin(2 * m_fa.λ + m_fa.l) - 0.0158 * sin(m_fa.l - 2 * m_fa.D) +
0.0123 * sin(2 * m_fa.λ - m_fa.l) + 0.0063 * sin(2 * m_fa.D) + (0.0063 + 0.00001 * m_ts) * sin(m_fa.λ + m_fa.l - m_fa.F) - 0.0123 * sin(2 * m_fa.λ - m_fa.l) + 0.0063 * sin(2 * m_fa.D) + (0.0063 + 0.00001 * m_ts) * sin(m_fa.λ + m_fa.l - m_fa.F) -
(0.0058 + 0.00001 * m_ts) * sin(m_fa.λ - m_fa.l - m_fa.F) - 0.0059 * sin(2 * m_fa.λ - m_fa.l + 2 * m_fa.D) - (0.0058 + 0.00001 * m_ts) * sin(m_fa.λ - m_fa.l - m_fa.F) - 0.0059 * sin(2 * m_fa.λ - m_fa.l + 2 * m_fa.D) -
...@@ -42,11 +42,11 @@ int RotationMatrix::calculateNutationParameters() { ...@@ -42,11 +42,11 @@ int RotationMatrix::calculateNutationParameters() {
0.0029 * sin(2 * m_fa.λ + m_fa.l - 2 * m_fa.D) - 0.0031 * sin(2 * m_fa.λ + 2 * m_fa.l) + 0.0026 * sin(2 * m_fa.F) + 0.0029 * sin(2 * m_fa.λ + m_fa.l - 2 * m_fa.D) - 0.0031 * sin(2 * m_fa.λ + 2 * m_fa.l) + 0.0026 * sin(2 * m_fa.F) +
0.0021 * sin(m_fa.λ - m_fa.l + m_fa.F) + 0.0016 * sin(m_fa.λ - m_fa.l - m_fa.F + 2 * m_fa.D) - 0.0021 * sin(m_fa.λ - m_fa.l + m_fa.F) + 0.0016 * sin(m_fa.λ - m_fa.l - m_fa.F + 2 * m_fa.D) -
0.0013 * sin(m_fa.λ + m_fa.l - m_fa.F - 2 * m_fa.D) - 0.0010 * sin(m_fa.λ - m_fa.l + m_fa.F + 2 * m_fa.D)); 0.0013 * sin(m_fa.λ + m_fa.l - m_fa.F - 2 * m_fa.D) - 0.0010 * sin(m_fa.λ - m_fa.l + m_fa.F + 2 * m_fa.D));
Δε = m_rs * ((9.2025 + 0.00089 * m_ts) * cos(m_fa.λ - m_fa.F) - (0.0895 - 0.00005 * m_ts) * cos(2 * m_fa.λ - 2 * m_fa.F) - Δε = RS * ((9.2025 + 0.00089 * m_ts) * cos(m_fa.λ - m_fa.F) - (0.0895 - 0.00005 * m_ts) * cos(2 * m_fa.λ - 2 * m_fa.F) -
0.0024 * cos(m_fa.λ - 2 * m_fa.l + m_fa.F) + (0.5736 - 0.00031 * m_ts) * cos(2 * m_fa.λ - 2 * m_fa.D) + 0.0024 * cos(m_fa.λ - 2 * m_fa.l + m_fa.F) + (0.5736 - 0.00031 * m_ts) * cos(2 * m_fa.λ - 2 * m_fa.D) +
(0.0054 - 0.00001 * m_ts) * cos(m_fa.L) + (0.0224 - 0.00006 * m_ts) * cos(2 * m_fa.λ + m_fa.L - 2 * m_fa.D) - (0.0054 - 0.00001 * m_ts) * cos(m_fa.L) + (0.0224 - 0.00006 * m_ts) * cos(2 * m_fa.λ + m_fa.L - 2 * m_fa.D) -
(0.0095 - 0.00003 * m_ts) * cos(2 * m_fa.λ - m_fa.L - 2 * m_fa.D) - 0.0070 * cos(m_fa.λ + m_fa.F - 2 * m_fa.D)); (0.0095 - 0.00003 * m_ts) * cos(2 * m_fa.λ - m_fa.L - 2 * m_fa.D) - 0.0070 * cos(m_fa.λ + m_fa.F - 2 * m_fa.D));
Δε += m_rs * ((0.0977 - 0.00005 * m_ts) * cos(2 * m_fa.λ) + 0.0200 * cos(m_fa.λ + m_fa.F) + (0.0129 - 0.00001 * m_ts) * Δε += RS * ((0.0977 - 0.00005 * m_ts) * cos(2 * m_fa.λ) + 0.0200 * cos(m_fa.λ + m_fa.F) + (0.0129 - 0.00001 * m_ts) *
cos(2 * m_fa.λ + 2 * m_fa.l) - 0.0053 * cos(2 * m_fa.λ - m_fa.l) - 0.0033 * cos(m_fa.λ + m_fa.l - m_fa.F) + cos(2 * m_fa.λ + 2 * m_fa.l) - 0.0053 * cos(2 * m_fa.λ - m_fa.l) - 0.0033 * cos(m_fa.λ + m_fa.l - m_fa.F) +
0.0032 * cos(m_fa.λ - m_fa.l - m_fa.F) + 0.0026 * cos(2 * m_fa.λ - m_fa.l + 2 * m_fa.D) + 0.0027 * cos(m_fa.λ + m_fa.l + m_fa.F) + 0.0032 * cos(m_fa.λ - m_fa.l - m_fa.F) + 0.0026 * cos(2 * m_fa.λ - m_fa.l + 2 * m_fa.D) + 0.0027 * cos(m_fa.λ + m_fa.l + m_fa.F) +
0.0016 * cos(2 * m_fa.λ + 2 * m_fa.D) - 0.0012 * cos(2 * m_fa.λ + m_fa.l - 2 * m_fa.D) + 0.0013 * cos(2 * m_fa.λ + 2 * m_fa.l) - 0.0016 * cos(2 * m_fa.λ + 2 * m_fa.D) - 0.0012 * cos(2 * m_fa.λ + m_fa.l - 2 * m_fa.D) + 0.0013 * cos(2 * m_fa.λ + 2 * m_fa.l) -
...@@ -54,7 +54,7 @@ int RotationMatrix::calculateNutationParameters() { ...@@ -54,7 +54,7 @@ int RotationMatrix::calculateNutationParameters() {
return 0; return 0;
}; };
int RotationMatrix::calculateMatrixNutation() { int ConvertSC::calculateMatrixNutation() {
Matrix a = Matrix::RotationOZ(-Δψ); Matrix a = Matrix::RotationOZ(-Δψ);
Matrix b = Matrix::RotationOX(m_ε); Matrix b = Matrix::RotationOX(m_ε);
Matrix c = Matrix::RotationOX(-m_ε - Δε); Matrix c = Matrix::RotationOX(-m_ε - Δε);
...@@ -63,7 +63,7 @@ int RotationMatrix::calculateMatrixNutation() { ...@@ -63,7 +63,7 @@ int RotationMatrix::calculateMatrixNutation() {
return 0; return 0;
} }
int RotationMatrix::rewrite() { int ConvertSC::rewrite() {
calculateTime(); calculateTime();
calculatePrecessionParam(); calculatePrecessionParam();
calculateMatrixPrecession(); calculateMatrixPrecession();
...@@ -72,4 +72,88 @@ int RotationMatrix::rewrite() { ...@@ -72,4 +72,88 @@ int RotationMatrix::rewrite() {
calculateNutationParameters(); calculateNutationParameters();
calculateMatrixNutation(); calculateMatrixNutation();
return 0; return 0;
} }
\ No newline at end of file
Matrix Earth_rot_matrix(double GTST) {
return Matrix::RotationOZ(GTST);
}
std::ostream& operator<<(std::ostream& out, precession_parameters& input_pp)
{
out << "-------------------------------------------------------------"
<< "\nPrecession parameters\n" << "ζα = " << input_pp.m_ζα
<< "\nθα = " << input_pp.m_θα << "\nm_zα = " << input_pp.m_zα
<< "\n-------------------------------------------------------------";
return out;
}
std::ofstream& operator<<(std::ofstream& out, precession_parameters& input_pp)
{
out << input_pp;
return out;
}
std::ostream& operator<<(std::ostream& out, fundamental_arguments& input_fa)
{
out << "\n-------------------------------------------------------------"
<< "\nfundamental arguments"
<< "\nλ = " << input_fa.λ << "\nl = " << input_fa.l
<< "\nL = " << input_fa.L << "\nF = " << input_fa.F
<< "\nD = " << input_fa.D;
return out;
}
std::ofstream& operator<<(std::ofstream& out, fundamental_arguments& input_fa)
{
out << input_fa;
return out;
}
std::ostream& operator<<(std::ostream& out, ConvertSC& input_CSC)
{
out << "\n*************************************************************"
<< "\nFields of the ConvertCS class"
<< "\nm_ε = " << input_CSC.m_ε << "\nΔψ = " << input_CSC.Δψ
<< "\nm_Δε = " << input_CSC.Δε << "\nm_t = " << input_CSC.m_t
<< "\nm_ts = " << input_CSC.m_ts << "\nprecession parameters = " << input_CSC.m_pp
<< "\precession matrix = " << input_CSC.m_precession << "\nutation matrix = " << input_CSC.m_nutation
<< "\fundamental arguments = " << input_CSC.m_fa;
return out;
}
std::ofstream& operator<<(std::ofstream& out, ConvertSC& input_CSC)
{
out << input_CSC;
return out;
}
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();
}
Matrix SC_to_DC(Matrix& GEC) {
return(Matrix{ 3, 1, {GEC(2,0) * cos(GEC(1, 0)) * cos(GEC(0,0)),
GEC(2,0) * cos(GEC(1, 0)) * sin(GEC(0,0)),
GEC(2,0) * sin(GEC(1, 0)) } });
};
\ No newline at end of file
#pragma once #pragma once
#include "Matrix.h" #include "Matrix.h"
const double RS = 4.848136811095 * pow(10, -6);
struct precession_parameters { struct precession_parameters {
double m_ζα; double m_ζα;
double m_θα; double m_θα;
double m_zα; double m_zα;
friend std::ostream& operator<<(std::ostream& out, precession_parameters& input_pp);
friend std::ofstream& operator<<(std::ofstream& out, precession_parameters& input_pp);
}; };
struct fundamental_arguments { struct fundamental_arguments {
double λ; double λ;
double l; double l;
double L; double L;
double F; double F;
double D; double D;
friend std::ostream& operator<<(std::ostream& out, fundamental_arguments& input_fa);
friend std::ofstream& operator<<(std::ofstream& out, fundamental_arguments& input_fa);
}; };
class ConvertSC {
class RotationMatrix { protected:
private:
const double m_rs = 4.848136811095 * pow(10, -6);
const double m_rg = 0.017453292519943296; const double m_rg = 0.017453292519943296;
double m_ε{ 0 }; double m_ε{ 0 };
...@@ -32,9 +35,9 @@ private: ...@@ -32,9 +35,9 @@ private:
fundamental_arguments m_fa{ 0,0,0,0,0 }; fundamental_arguments m_fa{ 0,0,0,0,0 };
public: public:
RotationMatrix(double input_time = 0) : m_t{ input_time } { rewrite(); }; ConvertSC(double input_time = 0) : m_t{ input_time } { rewrite(); };
~RotationMatrix() {}; ~ConvertSC() {};
int settime(double input_TDB, bool i_rewrite = true) { int settime(double input_TDB, bool i_rewrite = true) {
m_t = input_TDB; m_t = input_TDB;
if (i_rewrite) rewrite(); if (i_rewrite) rewrite();
...@@ -47,7 +50,7 @@ public: ...@@ -47,7 +50,7 @@ public:
int calculatePrecessionParam(); int calculatePrecessionParam();
int calculateMatrixPrecession(); int calculateMatrixPrecession();
int calculateAngleInclination() { int calculateAngleInclination() {
m_ε = m_rs * (84381.448 - (46.815 + (0.0059 - 0.001813 * m_t) * m_t) * m_t); m_ε = RS * (84381.448 - (46.815 + (0.0059 - 0.001813 * m_t) * m_t) * m_t);
return 0; return 0;
} }
int calculateFundamentalArguments(); int calculateFundamentalArguments();
...@@ -58,35 +61,17 @@ public: ...@@ -58,35 +61,17 @@ public:
double getΔψ() { double getΔψ() {
return Δψ; return Δψ;
} }
double getε() { double getε() {
return m_ε; return m_ε;
} }
};
namespace coord_sys { friend std::ostream& operator<<(std::ostream& out, ConvertSC& input_CSC);
Matrix Earth_rot_matrix(double GTST) { friend std::ofstream& operator<<(std::ofstream& out, ConvertSC& input_CSC);
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) { Matrix AEC_to_CC(Matrix &Precession);
return CC_to_TC.Transpose(); Matrix CC_to_TEC(Matrix& Precession, Matrix& Nutation);
} Matrix TEC_to_CC(Matrix& TEC);
}; Matrix CC_to_TC(Matrix& Precession, Matrix& Nutation, Matrix& ERM);
\ No newline at end of file Matrix TC_to_CC(Matrix& CC_to_TC);
Matrix SC_to_DC(Matrix& GEC);
\ No newline at end of file
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
<ClCompile Include="Matrix.cpp" /> <ClCompile Include="Matrix.cpp" />
<ClCompile Include="orbit_time.cpp" /> <ClCompile Include="orbit_time.cpp" />
<ClCompile Include="orbit.cpp" /> <ClCompile Include="orbit.cpp" />
<ClCompile Include="Planets.cpp" />
<ClCompile Include="SystemCoords.cpp" /> <ClCompile Include="SystemCoords.cpp" />
<ClCompile Include="Undisturbed_movement.cpp" /> <ClCompile Include="Undisturbed_movement.cpp" />
</ItemGroup> </ItemGroup>
...@@ -151,6 +152,7 @@ ...@@ -151,6 +152,7 @@
<ClInclude Include="Matrix.h" /> <ClInclude Include="Matrix.h" />
<ClInclude Include="orbit.h" /> <ClInclude Include="orbit.h" />
<ClInclude Include="orbit_time.h" /> <ClInclude Include="orbit_time.h" />
<ClInclude Include="Planets.h" />
<ClInclude Include="SystemCoords.h" /> <ClInclude Include="SystemCoords.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
<ClCompile Include="SystemCoords.cpp"> <ClCompile Include="SystemCoords.cpp">
<Filter>Исходные файлы</Filter> <Filter>Исходные файлы</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Planets.cpp">
<Filter>Исходные файлы</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="orbit.h"> <ClInclude Include="orbit.h">
...@@ -44,5 +47,8 @@ ...@@ -44,5 +47,8 @@
<ClInclude Include="SystemCoords.h"> <ClInclude Include="SystemCoords.h">
<Filter>Файлы заголовков</Filter> <Filter>Файлы заголовков</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Planets.h">
<Filter>Файлы заголовков</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -17,7 +17,7 @@ class Ot { ...@@ -17,7 +17,7 @@ class Ot {
private: private:
const double m_correction = 69.184; // TAI UTC TT TAI const double m_correction = 69.184; // TAI UTC TT TAI
std::timespec c_time{ 0,0 }; std::timespec c_time{ 0,0 };
RotationMatrix m_matrix{}; ConvertSC m_matrix{};
public: public:
Ot() { Ot() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment