In the longitudinal method, the magnetization is normal to the surface. A transition region (domain walls) is formed between domains, in which the magnetic field exits the material. If the domain wall is located at the interface of two north-pole domains then the field is directed outward, and for two south-pole domains it is directed inward. To read the direction of the magnetic field above the domain wall, the magnetization direction is fixed normal to the surface in the antiferromagnetic layer and parallel to the surface in the sensing layer. Changing the direction of the external magnetic field deflects the magnetization in the sensing layer. When the field tends to align the magnetizations in the sensing and fixed layers, the electrical resistance of the sensor decreases, and vice versa.