block by vasturiano 8105c6b44c064e49a046ae1fb07c9f4f

Plasma

Full Screen

Simulation 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.

index.js

index.html

style.css