Relationship between distance and strength of magnetic field