/* * Copyright (c) 2025 Konrad Gębik * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see */ #pragma once #include "Vector.hpp" class Simulation { Vector position, velocity; double time = 0, deltaTime; double mass1, mass2; double PNorder; //Calculates the RHS of the equation of motion as given by Pati and Will Vector PNapprox(double time, Vector pos, Vector vel); public: Simulation(double mass1, double mass2, double delta, double PNorder, Vector pos, Vector vel) : mass1(mass1), mass2(mass2), deltaTime(delta), PNorder(PNorder), position(pos), velocity(vel){}; Vector getPosition() const; Vector getVelocity() const; double getTime() const; double getEnergy() const; //Moves the simulation one step forward using RK4 void simulate(); };