Magnetic forces are very closely related to electric forces. Even though they appear to be distinct from each other , they are thought of as different aspects of a single electromagnetic force. A flow of charged particles (including an electric current) creates a magnetic field around the moving particles or the current carrying wire. Motion in a nearby magnet is evidence of this field. Electric currents in Earth’s interior give Earth an extensive magnetic field, which is detected from the orientation of compass needles. The motion of electrically charged particles in atoms produces magnetic fields. Usually these magnetic fields in an atom are randomly oriented and therefore cancel each other out. In magnetic materials, the subatomic magnetic fields are aligned, adding to give a macroscopic magnetic field.