🧪 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.
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.
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.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install