Skip to content

This project is a simulation of rectangular blocks colliding with each other and losing energy based on their coefficient of restitution. It serves as a basic illustration for the physics community to understand and study the topic of collisions. The simulation is implemented using Python's Pygame framework.

Notifications You must be signed in to change notification settings

nitin-kumar101/collision-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Rectangular Block Collision Simulation

This project is a simulation of rectangular blocks colliding with each other and losing energy based on their coefficient of restitution. It serves as a basic illustration for the physics community to understand and study the topic of collisions. The simulation is implemented using Python's Pygame framework, providing an interactive visual representation of the collision dynamics.

Installation

  1. Clone or download this repository to your local machine.

  2. Ensure that you have Python installed on your system. If not, you can download and install Python from the official website: Python.org

  3. Install the Pygame library by running the following command:

    pip install pygame
    

Usage

  1. Open the project directory on your local machine.

  2. Open the main.py file in a text editor.

  3. Set the desired parameters for the simulation:

    • num_blocks: Number of rectangular blocks in the simulation.
    • block_width: Width of each rectangular block.
    • block_height: Height of each rectangular block.
    • restitution: Coefficient of restitution for the collisions.
  4. Then, The simulation window will open, showing the rectangular blocks colliding and losing energy based on the coefficient of restitution.

  5. Observe the dynamics of the collisions and analyze the behavior of the blocks.

Contributing

Contributions, suggestions, and improvements are welcome! If you have any ideas to enhance the simulation or discover any issues, please open an issue or submit a pull request.

Acknowledgments

Special thanks to the Pygame development team for providing an excellent framework for game and simulation development in Python.

Enjoy exploring the simulation of rectangular block collisions!

Simulation Sample

image

About

This project is a simulation of rectangular blocks colliding with each other and losing energy based on their coefficient of restitution. It serves as a basic illustration for the physics community to understand and study the topic of collisions. The simulation is implemented using Python's Pygame framework.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages