Bar Magnet & Iron Filings

A bar magnet is approximated by two opposite magnetic poles ±qₘ placed at the ends of the bar, so the magnetic field at any point is the sum of two inverse-square contributions B = (μ₀/4π) Σ qₘ r̂/r². A few thousand short line segments — virtual iron filings — are scattered on the page and rotated at every frame to align with the local B direction; their brightness scales with |B|, so dense field regions near the poles glow and the looping closed lines from N to S emerge automatically. The magnet itself can be dragged and rotated to see how the field pattern follows.

Who it's for: Intro magnetism and field-line visualisation; pairs nicely with the magnetic-field and Hall-effect simulators.

Key terms

  • bar magnet
  • magnetic field lines
  • magnetic poles
  • iron filings
  • field visualisation
  • dipole field

How it works

Iron filings on a card make the magnetic field of a **bar magnet** visible. Each filing is a tiny dipole that lines up with the local B; together they trace the **field lines** from N to S. Drag the magnet around — the lines reorganise in real time.

Key equations

B(r) = Σ_p (q_p / |r − r_p|³)·(r − r_p) (two-pole model)
A filing aligns with the local B direction (no torque only when parallel).

Frequently asked questions

Are real iron filings actually monopoles?
No. Each filing is itself a tiny induced magnet: it polarises along the local field and then rotates so its own N–S axis lines up with B. The macroscopic effect — segments tracing field-line directions — is what we render here.
Is the two-pole model accurate far from the magnet?
Far away the field of any magnet looks like a magnetic dipole, which our two opposite poles reproduce exactly. Up close the model is a useful cartoon but misses the volumetric magnetisation distribution inside a real bar.
Why are the field lines closed loops?
∇·B = 0 means magnetic field lines never start or end in space — they always close on themselves, leaving the north pole, looping through the surrounding region, and re-entering at the south pole.