sample programs for Garmin watch with location and compass

Hello,

 

I would like to create an application for a Garmin watch.

Record a GPS coordinate and a heading (using the compass).

 

Create a virtual corridor from this point and in the direction of the heading.

Finally, provide the real-time distance between the actual position and the virtual corridor.

 

Where can I find sample programs?