Skip to content

Instantly share code, notes, and snippets.

@Ben1980
Created March 5, 2019 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben1980/002aa6ec730eee7bc0b20de9d5cee158 to your computer and use it in GitHub Desktop.
Save Ben1980/002aa6ec730eee7bc0b20de9d5cee158 to your computer and use it in GitHub Desktop.
class Solver {
public:
explicit Solver(double mEpsilon);
std::vector<Particle> solve(const std::vector<Particle> &particles) const;
private:
std::vector<Particle> calculateAcceleration(const std::vector<Particle> &particles) const;
std::vector<Particle> calculateVelocity(const std::vector<Particle> &particles) const;
std::vector<Particle> calculatePosition(const std::vector<Particle> &particles) const;
static Particle AccumulateAcceleration(const std::vector<Particle> &particles, const Particle &particle);
static double CalculateEquivalentMass(const Particle &particleA, const Particle &particleB);
static const double G;
static const double EPSILON;
double mEpsilon;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment