compass error calculation