Giter Club home page Giter Club logo

mominalix / particle-physics-simulator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 97 KB

This repository contains a simple particle physics simulation that demonstrates the behavior of particles with gravitational effects. The simulation is implemented using Pygame for visualization and PyOpenGL for rendering.

Python 96.41% C 3.59%
computational-physics computational-science high-performance-computing numerical-simulations particle-simulation computational-engineering python opengl

particle-physics-simulator's Introduction

Particle Physics Simulation with Gravitational Effects

This repository contains a simple particle physics simulation that demonstrates the behavior of particles with gravitational effects. The simulation is implemented using Pygame for visualization and PyOpenGL for rendering.

Prerequisites

  • Python 3.x
  • Pygame (install using pip install pygame)
  • PyOpenGL (install using pip install PyOpenGL)

How to Run

  1. Clone the repository to your local machine using Git or download the ZIP file.

  2. Open a terminal or command prompt and navigate to the repository's directory.

  3. Run the simulation script using the one of the following commands:

    python random_particle_simulation_2d.py
    python random_particle_simulation_3d.py
    
  4. The simulation window will open, and you'll see particles moving and interacting with gravitational effects.

  5. To exit the simulation, simply close the window.

Functionality

The simulation showcases the following functionalities:

  • Particles: A number of particles are generated randomly on the screen, each with a random weight, initial position, and velocity.

  • Gravitational Effects: Particles experience a simplified form of gravitational interaction. As particles cross each other, their velocities and directions are affected by the gravitational pull based on their weights.

  • Bouncing off Borders: The particles bounce off the borders of the simulation window, creating a bouncing effect when they reach the edges.

particle-physics-simulator's People

Contributors

manuparra avatar mominalix avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

manuparra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.