Magnetic Force and Magnetic Field




Magnetic Force

The force that acts between magnets is called magnetic force. Unlike gravity, magnetic force can be either attractive or repulsive.
When opposite poles of two magnets are brought close together, they attract each other. When like poles are brought close together, they repel each other.

A magnetic field exists around a magnet, and its pattern can be represented using magnetic field lines.
Outside a magnet, magnetic field lines are drawn in the direction from the north (N) pole to the south (S) pole.
When opposite poles face each other, magnetic field lines connect the two poles. When like poles face each other, the field lines bend outward away from the region between them.

When a compass is placed near a magnet, its needle rotates according to the direction of the magnetic field.
The direction indicated by the north pole of the compass needle is the direction of the magnetic field at that location.

This simulation provides a simplified representation of magnetic field patterns. It does not calculate the actual magnitude of the magnetic forces between magnets or simulate their motion.

December 24, 2022 update: Improved the smoothness of magnetic field lines connecting magnets.
November 4, 2024 update: Added a compass.