Home▸Electromagnetism▸Magnetic Field Lines Simulation (2D)

🧲 Magnetic Field Lines Simulation (2D)

Canvas2D companion: trace bar-magnet field lines with the two-pole (Gilbert) model and watch compass needles align to them, or switch to a current-carrying wire and launch charged particles that curve under the real Lorentz force.

Electromagnetism2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-magnetic-field-lines-simulation ↗ Open standalone
⚙ Under the hood

Canvas2D companion: trace bar-magnet field lines with the two-pole (Gilbert) model and watch compass needles align to them, or switch to a current-carrying wire and launch charged particles that curve under the real Lorentz force.

magnetic fieldfield lineselectromagnetismLorentz forcecompassAmpere's law

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

What did you find?

Add reproduction steps (optional)