-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.h
48 lines (31 loc) · 829 Bytes
/
functions.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
#ifndef functions_H
#define functions_H
#include <vector>
#include "planet.h"
#include <iostream>
#include <fstream>
#include <iomanip>
using std::vector;
//A class with functions used to solve project 3
class functions
{
//setting planet as friend class
friend class planet;
public:
//initializers
functions();
functions(double r);
// properties
int n_planets;
double radius, mass_tot, G, mass_sun;
vector<planet> planets;
//functions
void add(planet newplanet);
void GravitationalForce(planet ¤t, planet &other, double &Fx, double &Fy);
void VerletV(double total_time, int N);
void VerletVM(double total_time, int N);
//Euler solver
//euler(double dim, double pos, double vel, int N, double totaltime);
//Verlet solver
};
#endif // functions_H