Skip to content

Corentin-Mzr/nbody-cpp

Repository files navigation

N-Body Simulation C++

Description

Implementation of a customizable, to scale, N-Body simulation using C++ and SFML 3.0
Uses the Verlet integration method

Examples

Two body problem, circular orbit

Two body problem, circular orbit

Two body problem, elliptic orbit

Two body problem, elliptic orbit

Three body problem

Three body problem

Earth - Moon

Earth Moon barycenter orbit

And more

Usage

Create a custom JSON file or use a preexisting one

CLI soon

Installation

Prerequisites

  • C++ compiler (gcc, g++, cl, clang)
  • CMake 3.28 or newer

Clone the repository

git clone https://github.com/Corentin-Mzr/nbody-cpp

Build the project

From the root folder, execute the following commands

cmake -B build
cmake --build build

Run the program

To run the program, launch it from the build/bin folder

cd build/bin
./NBody.exe

More about

The N-Body problem

N-Body simulations

Verlet integration

Nlohmann's JSON Parser

SFML 3.0

Releases

No releases published

Packages

No packages published