A collection of interactive 2D physics simulations built using Pymunk (physics engine) and Pygame (rendering). These scripts visualize fundamental concepts in mechanics, chaos theory, and statistics.
A simulation of a pendulum with another pendulum attached to its end. It demonstrates chaotic motion, where the system is highly sensitive to initial conditions.
A vertical board with interleaved rows of pegs. Balls drop from the top, bouncing randomly left or right. It demonstrates how the Binomial Distribution approximates the Normal Distribution (Bell Curve) as the number of balls increases.
A classic simulation of a simple pendulum subject to gravity and damping, visualizing the conversion between potential and kinetic energy.
- Python 3
- Pymunk: 2D rigid body physics library.
- Pygame: Library for making visuals.
Clone the repository and install dependencies:
git clone [https://github.com/Alireza2317/Physics](https://github.com/Alireza2317/Physics)
cd Physics
# Install required libraries
pip install -r requirements.txtNavigate to the specific folder and run the script:
# Example: Running the Double Pendulum
cd double_pendulum
python app.py.
├── double_pendulum/ # Chaos theory simulation
├── galton_board/ # Statistical distribution simulation
├── pendulum/ # Simple harmonic motion
└── requirements.txt