A simulation of Gravitational Forces applied on flying object using Raylib.
Explore the files »
Report Bug
·
Request Feature
Table of Contents
This program uses F as following, to calculate the force applied on the flying objects.
The point is to simulate how gravitational forces are moving objects through space.
Two Spatial Bodies are displayed on the screen while flying objects go through
DemoGravitationalForces.mp4
Gcc as the compiler, C as the programming language and Raylib as the graphical library.
To get a local copy up and running, follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
- on Arch Linux : Gcc and make are already installed.
- on Ubuntu :
Verify that gcc and make are installed:
sudo apt install build-essential git
- Clone the repo
git clone https://github.com/MountainEnjoyer/GravitationalForces.git
- Install Raylib
- On Arch linux:
sudo pacman -S raylib
- On Ubuntu:
sudo apt install raylib
- Change the values of the simulation:
#define WIDTH 1200 #define HEIGHT 900 #define FPS 60 #define OBJ 100 #define R_OBJ 2 #define MASS_OBJ 10 #define XSPEED_OBJ 10 #define YSPEED_OBJ 0 #define BODY 2 #define MASS1 100 #define MASS2 500 #define G 0.6 // supposed to be 6.67*powf(10,-11); #define L_TRAIL 250
- Comile and execute by running:
make
- You can press ENTER to replay the simulation and ESC to exit it.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the Unlicense License. See LICENSE.txt for more information.
Zakary CHAUVE - contact@zakary.xyz
Project Link: https://github.com/MountainEnjoyer/GravitationalForces