Skip to content

2D Collision Simulator written in python, displayed using Matplotlib

Notifications You must be signed in to change notification settings

Ryan-Red/2D-Collision-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

2D Collision Simulator

Collisions' Gif

Introduction

This project is a simple 2D collision simulator to test elastic and inelastic collision physics.

This project is meant as a minimal working example that can be extended to include more complex forces.

What's Implemented

Parameters like the coefficient of restitution, collision detection and video generation are implemented.

How to use

Dependencies

This project depends on matplotlib and numpy, and also requires having ffmpeg installed on your computer.

To install matplotlib and numpy: pip install matplotlib numpy

To install ffmpeg go to: https://ffmpeg.org/download.html and follow the relevant steps.

Running the program

First, make sure to modify the parameter:

mpl.rcParams['animation.ffmpeg_path']

in the simulator.py code with the path to your ffmpeg installation.

Then, simply run python3 simulator.py to run the program. The output video will be saved as an mp4 video.

About

2D Collision Simulator written in python, displayed using Matplotlib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages