Home▸Magnetism▸Magnetic Pendulum Art (2D Top-Down)

🧪 Magnetic Pendulum Art (2D Top-Down)

2D top-down companion to the magnetic-pendulum art piece: the same spring + inverse-square magnet attraction + damping physics driving the trajectory, with a live readout panel and adjustable magnet strength, damping and trail opacity.

Magnetism2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-s26-magnetic-pendulum-art ↗ Open standalone

This 2D companion drives the exact same equations of motion as the 3D original — a spring-like restoring force toward the pivot plus inverse-square attraction from three fixed magnets, damped by friction — but draws them top-down on a plain canvas instead of orbiting a 3D scene. The trail is colored by whichever magnet is currently closest, so the fractal basins of attraction build up visibly over time, and a live readout panel shows the bob's position, speed and nearest magnet at every instant.

⚙ Under the hood

Canvas2D port of the magnetic-pendulum-art physics: spring restoring force + inverse-square magnet attraction (softened to avoid singularities) + linear damping, integrated with 4 Euler substeps per frame, same constants as the 3D version.

magnetic pendulumchaosbasins of attractionsensitivity to initial conditionsdamped oscillator

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

What did you find?

Add reproduction steps (optional)