A method and system are provided for determining a heading angle of a user of a portable electronic device in an indoor environment. In an embodiment, the device collects rotational movement information indicative of rotational movement of the device and determines a first heading angle of the device. The first heading angle is determined by using the downward direction of the device to determine the vertical angular rate in the horizontal plane, and integrating the vertical angular rate to form the first heading angle. The device collects first direction information from a first direction sensor and second direction information from a second direction sensor and uses it determine which of the first and second direction information is an outlier, e.g., inaccurate due to an occurrence of a disturbance. The device then corrects the heading angle by comparing the heading angle to the first and second direction information.
展开▼