A magnetic compass apparatus and method to account for magnetic distortion
while determining a magnetic heading is disclosed. The method enables a
compass module, comprising at least two magnetometers, to characterize
its magnetic environment dynamically, while collecting data of a
geomagnetic field; a user moves an apparatus through various
orientations; the environment may or may not contain magnetic distortion
influences. Data gathered by magnetometers and, optionally,
accelerometers are processed through at least two filters before being
transferred as a processed data set for repetitive measurement
calculations. A series of calculations is executed recursively in time by
solving one or more linear vector equations using processed data.