Presets
Playback
Magnets
Set a moment to 0 to switch a magnet off. Drag magnets and the probe on the map.
Layers
Model checks
The science
The dipole field
Far from a small magnet the field depends only on its magnetic moment m: B = (μ0/4π) [3 (m·r̂) r̂ − m] / r3. On the axis this is 2 (μ0/4π) m / r3 and on the equatorial plane (μ0/4π) m / r3 pointing the opposite way, so the on-axis field is exactly twice as strong. Doubling the distance cuts the field to one eighth.
Field lines
A field line is a curve that is everywhere tangent to B. For one dipole every line has the polar form r = L sin2θ (θ measured from the axis), where L is the distance at which the line crosses the equator. Here lines are traced numerically with a fourth-order Runge-Kutta step and seeded with equal flux between neighbours, so neighbouring lines are closer together where the field is stronger. The page plots the field in the plane that contains both moments, where the dipole formula is exact.
Forces on a second magnet
A magnet B in the field of A has energy U = −mB·BA and feels a torque τ = mB × BA. In compass mode B is a free needle: I d²φ/dt² = −mB BA sinφ, which for small angles oscillates with period T = 2π √(I / (m B)). Opposite poles facing each other lower the energy (attraction), like poles raise it (repulsion).
Honest simplifications: magnets are point dipoles drawn as bars (the real field of a 10 cm bar differs within about one length of its poles), the plane map ignores the third dimension, there is no magnetic material, hysteresis or demagnetisation, and the compass pivot is fixed so only torque, not force, acts on B.
What to try
- Start with Single dipole: the probe reads twice the equatorial value when you drag it from the axis to the equator at the same distance.
- Try Attract and Repel: the lines join up or push apart, and the energy graph shows the sign.
- Turn on compass needles to see the local field direction everywhere.
- Choose Compass needle and watch it swing about the field direction; change the damping.