# Magnetic field lines of permanent magnets & current-carrying wires | How to calculate the magnetic field at an arbitrary distance from the wire?

Let’s learn the idea of magnetic field lines of permanent magnets & current-carrying wires, how these lines behave in the situation of permanent magnets and current-carrying wires, and also how to calculate the magnetic field at an arbitrary distance from the current-carrying wire. You can quickly revise the Magnetic field and magnetic field line properties here.

## Magnetic field lines of permanent magnets

Permanent magnets (like refrigerator magnets) consist of atoms, such as iron, for which the magnetic moments (roughly electron spin) of the electrons are “lined up” all across the atom. This means that their magnetic fields add up, rather than canceling each other out. The net effect is noticeable because so many atoms have lined up. The magnetic field of such a magnet always points from the north pole to the south. The magnetic field of a bar magnet, for example, is illustrated below:

If we were to cut the magnet above in half, it would still have north and south poles; the resulting magnetic field would be qualitatively the same as the one above (but weaker).

## Magnetic field lines generated by current-carrying wires

### how to calculate the magnetic field at an arbitrary distance from the current-carryingwire?

Charged particles in motion also generate magnetic fields. The most frequently used example is a current-carrying wire since current is literally moving charged particles. The magnitude of a field generated by a wire depends on the distance to the wire and the strength of the current (I). We use the formula below to calculate the magnetic field at an arbitrary distance from the current-carrying wire.

### how to find the direction of the magnetic field at an arbitrary distance from the current-carryingwire?

Meanwhile, its direction can be found using the so-called first right-hand rule: point your thumb in the direction of the current. Then, curl your fingers around the wire. The direction your fingers will point in the same direction as the field. Be sure to use your right hand! To find the Direction of the Magnetic field lines generated by current-carrying wires using the so-called first right-hand rule

## Representing 3-dimensional magnetic fields on a Two-dimensional sheet of paper

Sometimes, it is necessary to represent such three-dimensional fields on a two-dimensional sheet of paper. The following example illustrates how this is done.