Home▸Chaos & Dynamics▸Magnetic Chaotic Pendulum (2D): Basin-of-Attraction Map

🧲 Magnetic Chaotic Pendulum (2D): Basin-of-Attraction Map

Top-down 2D companion to the 3D Magnetic Chaotic Pendulum: the same gravity + magnet + damping equations, plus a progressively-computed basin-of-attraction map that draws the fractal boundary between magnets directly on the plane instead of implying it from a single trail.

Chaos & Dynamics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-magnetic-chaotic-pendulum ↗ Open standalone

The 3D version of this pendulum is best for watching one chaotic trail loop across the base plane while orbiting the camera around it. This 2D companion drives the identical restoring-force-plus-magnet-plus-damping equations, but from directly above and with a second layer the 3D scene has no room for: a basin-of-attraction map, computed pixel by pixel in the background by releasing a stationary test bob at every point and recording which magnet eventually captures it. The result is the classic magnetic-pendulum fractal — interleaved colored regions with boundaries that stay ragged no matter how far you'd zoom in — sitting directly under the live bob's trail, so you can click anywhere and watch the bob settle on exactly the color the map already predicted.

⚙ Under the hood

2D top-down magnetic-pendulum lab: the same gravity + magnet + damping equations as the 3D version, plus a progressively-computed basin-of-attraction map that shows the fractal boundaries between magnets directly.

magnetic pendulumbasin of attractionchaos theoryfractal boundarysensitivity to initial conditions

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)