-
Notifications
You must be signed in to change notification settings - Fork 0
/
planet.h
38 lines (31 loc) · 876 Bytes
/
planet.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 PLANET_H
#define PLANET_H
#include <cmath>
#include <vector>
using std::vector;
//A class used for planets in project 3
class planet
{
public:
//Planet Values
double mass;
double vel[2]; //x and y velocity
double pos[2]; //x and y position
double potential;
double kinetic;
//Initializers
planet();
planet(double M, double x, double y, double vx, double vy);
//Functions
double distance(planet otherPlanet);
double distance_x(planet otherPlanet);
double distance_y(planet otherPlanet);
double GravitationalForce(planet otherPlanet, double G);
double Acceleration(planet otherPlanet, double G);
double KineticEnergy();
double PotentialEnergy(planet &otherPlanet, double G, double Eps);
double PotentialEnergySun();
double AngularMom();
double radiusFromSun();
};
#endif // PLANET_H