Home▸Electromagnetism▸Bar Magnet Dipole Field Lines: Top View, Compass Needle and Energy Well (2D)

Bar Magnet Dipole Field Lines: Top View, Compass Needle and Energy Well (2D)

A top view of the dipole field lines, the compass needle with the magnet, Earth and net field vectors, and the potential-energy well U(alpha) = -m_c B cos(alpha - beta) in which the needle oscillates.

Electromagnetism2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Bar Magnet Dipole Field Lines: Top View, Compass Needle and Energy Well (2D) ↗ Open standalone

A bar magnet modelled as a point magnetic dipole lies on a workbench. Field lines are traced by integrating the dipole field B = (mu0/4pi)(3(m.r)r/r^2 - m)/r^3 and obey r = L sin^2(theta). A small compass needle placed beside it feels the torque m x B, swings, damps and settles along the sum of the magnet field and Earth's field, following the tangent law. Move the compass, change the magnet strength and Earth's field, and check the numbers against a Biot-Savart current loop, the pendulum period, energy conservation and the elliptic-integral period. Built with a Blender bench, magnet and compass.

⚙ Under the hood

A top view of the dipole field lines, the compass needle with the magnet, Earth and net field vectors, and the potential-energy well U(alpha) = -m_c B cos(alpha - beta) in which the needle oscillates.

Magnetic DipoleField LinesBar MagnetCompassTorque on a DipoleTangent LawEarth's Magnetic FieldBiot-Savart Law

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)