autonmous robot (gps+compass)

Hi I want to interface a gps and compass to arduino for autonmous mobile robot, anybody help me how we calculate the heading angle and the distance?

You can't calculate the distance. The heading angle is simply the angle you measure as north.

what i mean i want to move form point to other point (predetermined) so im using the gps for get the conrdination for calculate the distance and the compass for the heading angle, for that i need help for the code...

Here's a link to the formulas you will need and some useful hints on implementation.

http://williams.best.vwh.net/avform.htm

http://en.wikipedia.org/wiki/Great-circle_navigation