Plasma
This interactive visualization simulates charged particles—large crimson protons and small darkslategrey electrons—that attract and repel based on an inverse-square magnetic force, while non-elastic collision prevents overlap. Sliders adjust the particle count and the positive/negative ratio, showcasing the emergent clustering dynamics. Built with D3.js, it uses `d3.forceSimulation` with custom `forceMagnetic`, `forceBounce`, and `forceSurface` plugins, rendering as SVG circles updated on each tick. The code defines particle generation from a density parameter and applies hard boundary limits to keep them on screen.
AI-generated descriptionSimulation of attraction-of-opposites particles, similar to the interaction between protons and electrons.
Uses D3's force plugin forceMagnetic to simulate the asymmetrical attraction/repulsion of objects in an inverse-square relationship with distance. Further, particles are prevented from overlapping by applying a non-elastic collision force using forceBounce.
Using the slider controls you can add/remove particles to the system, and regulate the ratio of positive (+) vs negative (-) particles.
forked from <a href='http://bl.ocks.org/vasturiano/'>vasturiano</a>'s block: <a href='http://bl.ocks.org/vasturiano/8105c6b44c064e49a046ae1fb07c9f4f'>Plasma</a>