Dancing circles

Click on the canvas to add circles. Watch how they dance with each other when they are close enough.

More precisely, each pair of circles whose distance is within a threshold rotate around the midpoint of their midpoints.

Use the menu on the left to change the threshold, adjust size and orientation of the next circle, delete the last or all circles, toggle lines between dancing circles, toggle trails of circles, toggle dark mode, or pause the simulation.

You can find the source code here.