I'd also offer the slight correction that a GPS is not figuring heading on changes in position, but it is looking at the velocities. Mathematically it is a better solution. GPS engines calculate not only position but also North and East velocities, then it's a simple bit of trig to get the direction you are traveling.
-- IFMU