-
Notifications
You must be signed in to change notification settings - Fork 19
/
Orbit.h
executable file
·67 lines (56 loc) · 2.04 KB
/
Orbit.h
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
#ifndef ORBIT_H
#define ORBIT_H
#include <Constants.h>
#include <PointPol.h>
#include <Planet.h>
#include <sstream>
class Orbit
{
public:
Orbit(const Orbit& orbit);
Orbit(const Planet* planet, double a, double e, double i, double Omega = 0.0, double omega = 0.0, double tp = 0.0);
virtual ~Orbit();
void update(double dt);
void updatePosition(double dt);
PointPol getPositionPoint() const;
PointPol getPointAt(double M) const;
void print() const;
void updateSim(double dt);
void reset(void);
double getA(void) const {return m_a;}
void setA(double a) {m_a = a;}
double gete(void) const {return m_e;}
void sete(double e) {m_e = e;}
double getI(void) const {return m_i;}
void setI(double i) {m_i = i;}
double getOmega(void) const {return m_Omega;}
void setOmega(double Om) {m_Omega = Om;}
double getomega(void) const {return m_omega;}
void setomega(double om) {m_omega = om;}
double getN(void) const {return std::sqrt(m_mu/std::pow(m_a, 3.0));}
double getV(void) const {return m_v;}
double getE(void) const {return m_E;}
double getM(void) const {return m_M;}
void setM(double M);
double getTp(void) const {return m_tp;}
void setTp(double tp) {m_tp = tp;}
const Planet* getPlanet(void) const {return m_planet;}
double getRa(void) const {return m_a*(1.0+m_e);}
double getRp(void) const {return m_a*(1.0-m_e);}
const std::string toString(void) const;
private:
const Planet* m_planet;
double m_a;
double m_e;
double m_i;
double m_Omega; // longitude of ascending node
double m_omega; // argument of periapsis
// satellite motion
double m_v;
double m_E;
double m_M;
// Initial constants
double m_tp;
double m_mu;
};
#endif // ORBIT_H