<p>An electronic compass (10) for use in a boring tool (12) which will provide an orientation of the boring tool relative to the earth's magnetic field. In addition, a more straightforward left or right deviation from an initial bearing can be determined. The invention can correct for pitch angle and roll angle variation as well. The magnetic field is sensed by an axial magnetic field (12), a radial magnetic field sensor (18) and a plane-normal magnetic sensor (24) which are preferably magnetoresistive sensors.</p>