← All animations

🧲 Magnetic Fields

Every magnet is wrapped in an invisible field — a map of which way a tiny compass would point at every spot around it. You can't see it directly, but scatter iron filings nearby and they snap into looping curves that arc from the north pole to the south. Drag the magnets below and watch those curves redraw themselves in real time, traced from the real physics of a magnetic dipole.

1. One bar magnet — drag it, watch the field redraw

A bar magnet has two poles: north (red) and south (blue). The curves are field lines — each one is the path a compass needle would trace, always tangent to the field. They loop out of the north pole and back into the south. Drag the magnet anywhere on the canvas; toggle iron filings to see the same field as a grid of little dashes that each align to the local field direction.

Drag the magnet to move it

2. Two magnets — attraction vs. repulsion

Bring two magnets together and they push or pull depending on which poles face off: opposite poles attract, like poles repel. The force arrows grow rapidly as the magnets near each other — magnetic force falls off steeply with distance. Drag the right-hand magnet, and press Flip polarity to swap it from attract to repel.

Opposite poles face each other → attraction

3. The rules of the field

A few facts capture almost everything you just watched:

Earth's field lines emerge near the south geographic pole and re-enter near the north — a planet-sized bar magnet.