Simon has written a code about using Polar Distribution to create clusters in p5.js (JavaScript). The code is available online at:
https://alpha.editor.p5js.org/simontiger/sketches/Sy1CX71xZ
The little particles are attracted to one another but don’t overlap. This is a simpler kind of attraction where every particle has two perception radii: a minimum and a maximum perception radius. Two particles within each other’s maximum radius are attracted to each other but repel each other once one of them enters the other’s minimum radius:
Simon placed this project in a GitHub chat and got some interesting advice (make the mouse a repulser). In the video below he changes the code, creating a repulsing element: