Modelling and simulating physics via C++ and Python to explore and better understand the beauty of the physical world.
Approximating Gravity in C++ using the Barnes-Hut Algorithm. Using Quadtrees, gravity for far off clusters of particles that are close together are grouped and treated like bigger particles for which gravity is applied (just an approximation). This allows for O(N logN) time complexity making the simulation viable for huge number of particles.
- The simulation is currently under development, however you can still run
N-body Simulation/bin/main.exe
to view the progress
Projectile motion is a type of motion that occurs when an object moves in a gravitational field. In this simulation, a particle's trajectory is modeled based on user-defined attributes. These attributes determine the behavior of the ball during its motion. The simulation calculates the ball's trajectory at intervals of 0.2 seconds slowing the simulation for better visibility.
- In
Projectile Motion/
runpip3 install -r requirements.txt
to install the dependencies - To start the simulation run the python file
main.py
with:python3 main.py <initial_speed> <acceleration_due_to_gravity> <angle_of_projection>
Note: It's pip
and python
on windows systems