Git Product home page Git Product logo

gravity's Introduction

Screenshot 2024-02-28 080959

Particle Simulation

This project is a simple particle simulation implemented in Python using Pygame. It simulates the motion of particles under the influence of gravitational forces.

Description

The simulation consists of particles moving within a defined space, interacting with each other based on gravitational attraction. The particles are represented as small circles on the screen, and their motion is calculated using Newtonian mechanics.

Installation

To run the simulation, make sure you have Python,Numba and Pygame installed on your system. You can install Pygame using the following command:

pip install pygame pip install numba

Usage

  1. Clone this repository to your local machine.

  2. Navigate to the project directory.

  3. Run the main script using Python:

  4. Once the simulation window opens, you can interact with it by:

    • Adding particles: Press and hold the left CTRL key and click on the screen to add particles at the cursor position.
    • Generating particle configurations:
      • Press '1' to generate a line of particles at the current Y-coordinate of the cursor.
      • Press '2' to generate a circular cluster of particles around the cursor position.
      • Press '3' to generate a line of particles at the current X-coordinate of the cursor.
  5. Observe the particles' motion and interactions as they move around the screen.

gravity's People

Contributors

amalsam avatar

Watchers

 avatar

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.