Skip to content

2D particle simulation with Coulomb-like forces, toroidal boundaries, and live controls in JavaScript.

License

Notifications You must be signed in to change notification settings

xcontcom/particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particle Simulation in JavaScript

Preview

This project is an interactive 2D particle system demonstrating emergent behavior of charged particles under simplified electrostatic-like forces. The simulation:

  • Visualizes how particles attract or repel based on configurable charges.
  • Supports toggling between Coulomb-like 1/r² decay and linear 1/r decay.
  • Implements toroidal boundary conditions (particles wrap around the edges).
  • Provides a variety of tunable parameters, including force strength, inertia damping, and minimum interaction distance.

Features:

  • Toroidal space: no hard edges - particles seamlessly wrap.
  • Dynamic controls: adjust forces and damping live.
  • Custom initialization: offset the field or randomize starting positions.
  • This simulation is intended as an educational demo and a playground for experimenting with emergent patterns.

Demo


License

MIT License. See LICENSE for details.


Author

Serhii Herasymov

[email protected]

https://github.com/xcontcom

About

2D particle simulation with Coulomb-like forces, toroidal boundaries, and live controls in JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published