Magnetometers are used in directional drilling for oil or gas to detect the azimuth of the drilling tools near the drill. They are most often paired with accelerometers in drilling tools so that both the inclination and azimuth of the drill can be found.