Newer
Older
#ifndef orbit
#define orbit
#include <iostream>
#include <iomanip>
#include <cmath>
#include <fstream>
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
//p, e, prec, nutatation, omega, tau
struct elements_orbit
{
// [1]
double p; // p -
double e; // e -
double precession; //
double nutation; //
double omega;; // omega - /
double tau; // tau -
friend std::ostream& operator <<(std::ostream& out, const elements_orbit& i_elements_orbit);
friend std::ofstream& operator <<(std::ofstream& out, const elements_orbit& i_elements_orbit);
};
struct const_elements_ellipse_orbite
{
double a; //
double abs_c; //
double b; //
double n; //
double r_a; //
double r_p; //
double T; //
friend std::ostream& operator <<(std::ostream& out, const const_elements_ellipse_orbite& i_const_elements_ellipse_orbite);
friend std::ofstream& operator <<(std::ofstream& out, const const_elements_ellipse_orbite& i_const_elements_ellipse_orbite);
};
struct variable_elements_ellipse_orbit
{
double E; //
double M; //
double nu; //
double Vr; //
double r; //-
double u;
double dnu;
friend std::ostream& operator <<(std::ostream& out, const variable_elements_ellipse_orbit& i_variable_elements_ellipse_orbit);
friend std::ofstream& operator <<(std::ofstream& out, const variable_elements_ellipse_orbit& i_variable_elements_ellipse_orbit);
};
struct coordinates
{
double x;
double y;
double z;
friend std::ostream& operator <<(std::ostream& out, const coordinates& i_coordinates);
friend std::ofstream& operator <<(std::ofstream& out, const coordinates& i_coordinates);
};
struct speed_components
{
double v_x;
double v_y;
double v_z;
friend std::ostream& operator <<(std::ostream& out, const speed_components& i_speed_components);
friend std::ofstream& operator <<(std::ofstream& out, const speed_components& i_speed_components);
};
class Orbit {
private:
const double gravitational_parameter_Earth = 398600.4415; // /
std::ofstream log_coordinates;
Ot m_time{};
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
elements_orbit m_elements;
const_elements_ellipse_orbite m_const_ellipse{ 0,0,0,0,0,0,0 };
variable_elements_ellipse_orbit m_variable_ellipse{ 0,0,0,0,0,0 };
coordinates m_coordinates{0,0,0};
speed_components m_speed_components{ 0,0,0 };
int calculate_E(int accuracy);
int calculate_const_elements_ellipse();
int calculate_varible_elements_ellipse(double);
int calculate_coordinates();
int calculate_speed_components();
public:
Orbit(elements_orbit input_elements);
~Orbit() {
log_coordinates.close();
};
int modulation();
friend std::ostream& operator <<(std::ostream& out, const Orbit& out_orbit);
friend std::ofstream& operator <<(std::ofstream& out, const Orbit& out_orbit);
};
#endif