-
Notifications
You must be signed in to change notification settings - Fork 0
/
body.h
executable file
·38 lines (23 loc) · 890 Bytes
/
body.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
#ifndef BODY_H
#define BODY_H
#include <math.h>
#include "orbit.h"
#include "bodyConsts.h"
class Body {
public :
double get_mass () const {return mass;}; //return stored mass
double get_radius () const {return radius;}; //return stored radius
double get_volume () const; //calculate volume from radius
double get_density () const; //calculate density from volume and mass
double get_Hill_limit (const Body&) const; //
double get_roche_limit (Body&) const; //get roche limit
Body& operator+= (const Body&);
Body& operator= (const Body&);
Orbit orbitParameters; //orbit description
virtual void show() const = 0; //cout
protected :
double mass; //Unit: earth mass or sun mass
double radius; //Unit: earth radius
private :
};
#endif