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