This C++ program simulates planetary motion and renders it using OpenGL.
Configuration can be found in the Config.h in /src. Configurable values include:
- Number of Planets
- Simulation Speed
- Δt (Delta Time / Time Step)
- Window Size (on launch)
- Method / Solver
- Debug Mode
Various methods can be applied through Config.h, primarily the SOLVER variable, of which can be any option in the list directly above its declaration.
- Euler's Method (First Order Accuracy)
- Euler's Method is prone to energy drift, making it unstable for prolonged orbits.
- Velocity Verlet (Second Order Accuracy)
- Velocity Verlet is algebraically equivalent to Leapfrog, another second order accurate method.
- Runge-Kutta 4 (Fourth Order Accuracy)
- Runge-Kutta 4 is prone to energy drift, making it unstable for prolonged orbits and thus making it less reliable than Velocity Verlet.
All visual output is rendered through OpenGL. Use WASD/Arrow Keys allows for the movement of the camera and E/+ and Q/- for zooming in and out, respectively.
This program currently demonstrates approximately O(n^2) time complexity, but is in the process of being reduced to about O(nlog(n)) through the use of the Barnes-Hut Approximation Model.