{"id":20070756,"url":"https://github.com/jonas-scholz123/particle-simulation","last_synced_at":"2026-06-13T16:32:51.117Z","repository":{"id":129462924,"uuid":"323968630","full_name":"jonas-scholz123/particle-simulation","owner":"jonas-scholz123","description":"This is an efficient O(n) simulation of n particles in a 3D box. I have built my own little ascii-console animation to show the particles!","archived":false,"fork":false,"pushed_at":"2020-12-25T10:49:20.000Z","size":3403,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T11:48:55.043Z","etag":null,"topics":["collisions","ncurses","particles","performance","simulation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonas-scholz123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-23T17:55:47.000Z","updated_at":"2020-12-25T14:02:34.000Z","dependencies_parsed_at":"2023-05-13T11:31:06.113Z","dependency_job_id":null,"html_url":"https://github.com/jonas-scholz123/particle-simulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonas-scholz123/particle-simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonas-scholz123%2Fparticle-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonas-scholz123%2Fparticle-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonas-scholz123%2Fparticle-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonas-scholz123%2Fparticle-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonas-scholz123","download_url":"https://codeload.github.com/jonas-scholz123/particle-simulation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonas-scholz123%2Fparticle-simulation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267831533,"owners_count":24151241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collisions","ncurses","particles","performance","simulation"],"created_at":"2024-11-13T14:25:06.510Z","updated_at":"2025-10-30T15:18:01.280Z","avatar_url":"https://github.com/jonas-scholz123.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Particle Simulation\n\nThis is a simulation of n particles in a 3D box. In this version it is reduced to a 2D simulation (by fixing z coordinates and setting z-velocity = 0) to animate it.\n\n![](particles.gif)\n\n## Usage:\n\nRequires ncurses:\n\n```sudo apt-get install libncurses5-dev libncursesw5-dev```\n\nConfigure parameters in ``` simulation.cpp ```\n\nthen navigate to /src/ and (using g++ in this case) to compile and run execute\n\n```g++ simulation.cpp environment.cpp particle.cpp utils.cpp ascii.cpp -lncurses \u0026\u0026 ./a.out```.\n\nTested only on ubuntu 18.04.\n\n## Implementation\n\nCollisions are calculated and stored in a priority queue,\nafter initially calculating all particle-particle and particle-wall collisions,\nonly the particles involved in a collision need to be re-evaluated, as all other particles will continue in a straight line.\n\nThis reduces the time complexity of calculating collisions from O(n^2) (i.e. recalculating all collisions) -\u003e O(n) (recalculating only impacted collisions).\n\nInvalidated collisions events (i.e. those in which the colliding particle has\nbeen involved in another collision since the creation of the event) are simply discarded.\n\nKeeping the queue of collisions sorted has complexity O(log(n)).\n\nThis results in an efficient and fast simulation.\n\nThe ascii visualisation of the simulation (which can be set using the ascii bool in simulation.cpp) was implemented using nCurses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonas-scholz123%2Fparticle-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonas-scholz123%2Fparticle-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonas-scholz123%2Fparticle-simulation/lists"}