Magnetic Storm: Charged Particles in a Dipole Field (2D)
A top-down Canvas2D companion to the 3D magnetic-storm scene: ions and electrons are integrated with the real Lorentz force F = q(v × B) through a 1/r³ dipole field, so gyroradius, trapping and drift emerge from the equations instead of being animated by hand.
The 3D version of this scene animates a swirling particle cloud around a glowing core for effect; this 2D companion instead drives every particle with the actual physics a magnetic storm runs on. Each of a few hundred ions and electrons feels the Lorentz force F = q(v × B), where the field magnitude follows the equatorial dipole law B ∝ 1/r³ measured outward from a central "planet" — the same falloff that shapes Earth's real magnetosphere. A thin current-sheet band flips the field's sign across the mid-plane, so particles gyrate tightly near the core, drift and mirror in a trapping band farther out, and stream away entirely once they cross the outer boundary — visible directly in the live trapped-fraction and mean-gyroradius readouts rather than implied by a slider labelled "storm strength."
2D charged-particle magnetosphere lab: Lorentz-force integration (F = qv×B) through a 1/r³ dipole field with a sign-flipping current sheet, live gyroradius and trapped-fraction readouts, adjustable storm strength, injection speed and ion/electron charge mix.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install