Home▸Electromagnetism▸Electromagnet (2D)

🧲 Electromagnet (2D)

Side-view Canvas2D electromagnet: drive current through a wound coil, swap iron for air core, reverse polarity, and watch field lines and compass needles respond live.

Electromagnetism2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-electromagnetism ↗ Open standalone

This 2D companion drives the same B = μ·n·I solenoid formula as the 3D version through a flat side-view canvas: an iron or air core sits inside a wound coil, current-direction chevrons ride the coil, field-line loops arc from the north to the south pole, and a row of compass needles above and below the coil rotate to track the local field as you change current, turns or polarity.

⚙ Under the hood

2D side-view electromagnet lab: drive current through a wound coil, swap iron for air core, reverse polarity, and watch field lines and compass needles respond live.

Canvas 2DElectromagnetismSolenoidMagnetic Field

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

What did you find?

Add reproduction steps (optional)