An Adaptive Technique for Estimating Attitude from Earth Magnetic Field Data