Magnetic Field Lines

Drag a magnet to move it, drag either end to turn it, double-click to flip it. The field lines and the iron filings redraw as the magnets move.

Model: each bar magnet is treated as a pair of opposite point poles, and the field in the plane is the sum of inverse-square contributions from every pole. It is a teaching model of a bar magnet's field, not a full 3D calculation.