Skip to content
Snippets Groups Projects
Planets.h 1.91 KiB
Newer Older
#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 };

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

	friend std::ostream& operator<<(std::ostream& out, Moon& i_moon);
	friend std::ofstream& operator<<(std::ofstream& out, Moon& i_moon);
};

class Sun:private ConvertSC {
private:
	const double AU{ 149597870.691 };
	std::vector<double> m_M{ 0.0,0.0,0.0,0.0,0.0 };
	Matrix m_perturbation{ 3,1 }; // возмущение в эклептической долготе, возмущение в эклептической широте, возмущение в расстоянии до Солнца
	//возмущения в долготе обусловленные Венерой
	double DILong_V();
	double DILong_M();
	double DILong_JS();
	double DILat();
	double DIR_V();
	double DIR_M();
	double DIR_JS();

public:
	Sun(double input_TDB = 0) : ConvertSC{ input_TDB } {};
	~Sun() {};

	int calculateAverageAnomalies();
	int calculatePerturbation();
	int calculateGEC();
};

class Earth : private ConvertSC {
private:
	const double  gravitational_parameter_Earth = 398600.4415;
	uint32_t m_cols;
	uint32_t m_rows;
	Matrix m_GDC;
	double m_r;
	Matrix startPartialDeriv{4,3}; 

	
	Matrix coefficient_С = fill_matrix("coef_c.txt");
	Matrix coefficient_S = fill_matrix("coef_s.txt");

	Matrix fill_matrix(const char fileName []);
public:
	Earth() {};
	Earth(double , Matrix);
	~Earth() {};
	int calculateStartPartialDeriv();