|MadSci Network: Physics|
What you see "spreading" are the force lines of a static magnetic field. You can also see similar "spreading" phenomenon in the graph of force lines for a static electric field. The force lines are drawn according to two rules: 1. the tangent of the curve is parallel to the direction of the electric or magnetic field 2. the density of the curves is proportional to the intensity of the electric field or magnetic field However, it's hard to define the "density" for the force lines. Therefore the graph of force lines are generally just conceptual illustrations. The magnetic field of a permanent magnet is caused by magnetic dipole of unpaired electrons in that magnet. The magnetic field of a magnetic dipole can be calculated by using http://www.treasure-troves.com/physics/MagneticDipole.html There are a lot of magnetic dipoles in a magnet. If their positions and orientations are already known, we can calculate the magnetic field generated by them separately and then sum them up to obtain the magnetic field generated by the whole magnet. Therefore, it's the distribution of magnetic dipoles in a magnet which determines the magnetic field. By breaking a magnet into small pieces and rearranging them, you can even "design" a magnetic field.
Try the links in the MadSci Library for more information on Physics.