https://github.com/ayush272002/particle-motion-under-gravity
This project simulates the motion of a particle under gravity, with a focus on visualizing the particle's bounce and trajectory. It includes both a C++ implementation and a Python demo, as well as a sample video output.
https://github.com/ayush272002/particle-motion-under-gravity
cpp pybind11
Last synced: 10 months ago
JSON representation
This project simulates the motion of a particle under gravity, with a focus on visualizing the particle's bounce and trajectory. It includes both a C++ implementation and a Python demo, as well as a sample video output.
- Host: GitHub
- URL: https://github.com/ayush272002/particle-motion-under-gravity
- Owner: Ayush272002
- License: mit
- Created: 2025-08-16T11:53:16.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-16T11:59:48.000Z (11 months ago)
- Last Synced: 2025-08-16T13:49:25.246Z (11 months ago)
- Topics: cpp, pybind11
- Language: C++
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Particle Motion Under Gravity
This project simulates the motion of a particle under gravity, with a focus on visualizing the particle's bounce and trajectory. It includes both a C++ implementation and a Python demo, as well as a sample video output.
## Features
- Simulates particle motion under gravity
- Visualizes bouncing behavior
- C++ implementation (`particle.cpp`)
- Python demo script (`demo.py`)
- Example output video (`particle_bounce.mp4`)
## Files
- `particle.cpp`: C++ source code for the simulation
- `demo.py`: Python script for running and visualizing the simulation
- `requirements.txt`: Python dependencies
- `Makefile`: Build and run commands for the project
## Getting Started
### Prerequisites
- Python 3.x
- C++ compiler (e.g., g++)
## Setup & Usage
This project uses a `Makefile` to automate setup and running:
1. **Install dependencies and set up the Python virtual environment:**
```bash
make install
```
2. **Run the simulation and Python demo:**
```bash
make run
```
> This will automatically build the C++ extension if it hasn't been built yet, so running `make` separately is not required.
4. **Clean up build artifacts and the virtual environment:**
```bash
make clean
```
## Output
The simulation output can be visualized as a video below or through the Python script's visualization:
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.